blissfulness be with me.
Tuesday, 14 June 2016
one.sh is a simple Linux/BSD script which runs it arguments, but does nothing if a previous execution is still running (using a lock file.) It is ideal for use with cronjobs that run frequently (e.g. every minute) but which may have sporadic run times.
./one.sh wget –mirror mywebsite.com — mirrors mywebsite.com, but does nothing if ./one.sh –mirror mywebsite.com was previously launched and is still running.
./one.sh ocp http://mywebsite.com/sitemap.xml — primes the website’s cache using Optimus Cache Prime, but does nothing if the cache is already being primed.
md5sum and cut (to be able to run ./one.sh with different commands simultaneously and have a separate lock for each unique command. Edit LFILE in the script if these commands aren’t available, or if you only need a single lock.)
The above commands are available on most Linux and BSD systems。