ebay sniper manager
You want to use the esniper command line tool but don't want to start
and care the necessary instances manually every time.
These are all available as debian packages.
- python-pyinotify (and linux kernel 2.6.13 or later for inotify to work)
- python2.5 (or adapt the script (easy))
- download esniper-manager and unpack
- create a directory
- create the directories "auction" and "log" in directory
- make yourself familiar with esniper and drop auction files in the "auction"
- make sure "esniper-manager.py directory" is running
The last point of the list boils down to the many years old standard linux problem: how to let users start a daemon.
I know the following solutions:
- Set the daemon up as root. I don't want that.
- Use a vixie cron version that supports the @reboot macro, but buggy vixie cron
does not run correctly on my system. - If you know how to investigate why user tasks do not get executed, mail me. I replaced it with bcron which has no @reboot support.
- Use fcron and insert a line like "@0 10s ~/bin/esniper-manager.py /path/to/directory" in your fcrontab. We take advantage of the fcron feature here to not start several instances of any job by default. - This is what I do.
- Please inform me of any better solution (that does start up the daemon soon after a system boot and does not run a "still running" check script every minute)
What does it do?
esniper-manager.py watches directory/auction for file changes. If a file changes or new file appears, it (re)starts "esniper file" with stdout and stderr redirected to directory/log/file. If a file disappears, the corresponding esniper gets killed.
esniper-manager.py takes care of auction files in the /auction directory at startup by starting up a corresponding esniper but does not restart esnipers if they chose to exit. - See the log file for reasons and edit or "touch" the auction file to restart the esniper.
Take care when editing auction files in auction/ as temporary files in this directory could provoke esnipers getting started. Because of this the script ignores files which have characters which are not alphanumeric in unicode class sense. That means that russian and chinese characters are allowed, dots and commas are not.