diff --git a/Gemfile b/Gemfile index 261ac18..828de31 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,4 @@ source 'https://rubygems.org' -gem 'daemons' gem 'httparty' gem 'addressable' gem 'mediawiki_api' diff --git a/Gemfile.lock b/Gemfile.lock index e449454..4d0dfd3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,45 +1,43 @@ GEM remote: https://rubygems.org/ specs: addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) - daemons (1.3.1) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) faraday (0.17.3) multipart-post (>= 1.2, < 3) faraday-cookie_jar (0.0.6) faraday (>= 0.7.4) http-cookie (~> 1.0.0) faraday_middleware (0.14.0) faraday (>= 0.7.4, < 1.0) http-cookie (1.0.3) domain_name (~> 0.5) httparty (0.18.1) mime-types (~> 3.0) multi_xml (>= 0.5.2) mediawiki_api (0.7.1) faraday (~> 0.9, >= 0.9.0) faraday-cookie_jar (~> 0.0, >= 0.0.6) faraday_middleware (~> 0.10, >= 0.10.0) mime-types (3.3.1) mime-types-data (~> 3.2015) mime-types-data (3.2020.0512) multi_xml (0.6.0) multipart-post (2.1.1) public_suffix (4.0.5) unf (0.1.4) unf_ext unf_ext (0.0.7.7) PLATFORMS ruby DEPENDENCIES addressable - daemons httparty mediawiki_api BUNDLED WITH 2.0.2 diff --git a/README.md b/README.md index 3a84f9a..8980920 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,11 @@ # Catimporter Importa una categoria (con relative sottocategorie) da una wiki all'altra. ## Prerequisiti Avere installato Ruby e [bundler](https://bundler.io), dare `bundle install`. Tutte le dipendenze saranno così installate. ## Configurazione Eseguite lo script chiamato `process.rb` (per esempio, col comando `$ ruby process.rb`) vi verranno richiesti alcuni parametri fondamentali che verranno salvati in un file chiamato .config e ripresi automaticamente alle successive esecuzioni. -## Daemonizzare -Per rendere lo script in continua esecuzione (facendolo diventare un daemon) e controllarlo, è possibile usare i seguenti comandi ereditati dalla gem [daemons](https://github.com/thuehlinger/daemons): -``` -$ ruby bot.rb start - (process.rb is now running in the background) -$ ruby bot.rb restart - (...) -$ ruby bot.rb stop +## Eseguire ciclicamente +Potete aggiungere lo script alla crontab, chiedendo `which ruby` ed inserendo in crontab una cosa del genere (sostituendo user col nome del vostro utente, /usr/bin/ruby col risultato di which ruby e directory col path allo script): ``` +0 1 * * * user /usr/bin/ruby /directory/process.rb +``` \ No newline at end of file diff --git a/bot.rb b/bot.rb deleted file mode 100644 index b69f5bc..0000000 --- a/bot.rb +++ /dev/null @@ -1,3 +0,0 @@ -require 'daemons' - -Daemons.run('process.rb')