manolomartinez/greg — pull request #12 by natir (2013-09-27 16:32:21+00:00)
Title: Greg daemon mode

# Why greg daemon mode

I search a cli podcast manager for download podcast and listen it with my ampache server.
Greg is the only good result, but greg haven't mode daemon.

# Why didn't use greg sync in chron

First because i see this option after work 3 hours, and i didn't wanted get this work in trash.
Second because chron task isn't flexiblity like daemon.

# Daemon process

Use daemonic module for :
* fork sub-process
* change the user and some environement variable
* redirect standard and error output
* generate pid file

For each feed :
* Check if is the first time feed call in daemon
* Download the last podcast
* Save the hour of the podcast

* Read the time of podcast in remote feed and in save file
* If local is odler of remote :
* Download the last podcast
* Save the hour of the podcast
* Else :
* Nothing

Stop command :
* Kill the worker process.
* Erase the pid file.

# Option

--time : Required option, set the time (in second) after previous check to rerun

--user : Required option, the name of worker user

--log-dir : Default "/var/log/greg", the flooder of log file

--pid-file : Default "/var/run/greg/greg.pid", the path of pid file

# Note

I make change in daemonic, the pull request not yet accepted. You can use https://github.com/natir/daemonic, for test my code.