The command is implemented as a bash script and should work on both OS X and GNU/Linux. Once the counter reaches the value given via -n then every will remove the guard file and exec your command. As a convenience we also write the command to the guard file. The name of the guard file is derived from the arguments passed to every (using sha1) and the content of the guard file is a counter to keep track of how many times we have been called. If XDG_DATA_HOME is unset then it defaults to $HOME/.local/share. The command uses a guard file written to $XDG_DATA_HOME/every. Using this in a crontab to remind us every second Wednesday could be done as: # m h dom mon dow commandĠ0 12 * * wed every -n2 mail -s"Water the plants" <<< "It’s time again!" time we call it, use: every -n3 mail -s"Water the plants" <<< "It’s time again!" For example to send an email the third, sixth, ninth, etc. This will run command every number time it’s invoked. I run a few things via cron, some of them need to run in intervals that cannot be expressed, for example biweekly or every 8th month.Īs a general solution I created the every command available here.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |