Better Living Through Thinking |
|
Tell Even from Odd DaysTue, 17 Apr 2007Here's a small utility to tell even from odd days (useful in some crontabs): #!/usr/bin/perl -s exit(((localtime)[3]+($odd||0)) % 2); Save this to /usr/local/sbin/evenday, chmod 755 /usr/local/sbin/evenday and chown root:wheel /usr/local/sbin/evenday Now in your crons you can do this: ## on the even Tuesdays... * * * * 2 /usr/local/sbin/evenday && /run/some/even_backup.sh ## on odd-numbered Tuesdays... * * * * 2 /usr/local/sbin/evenday -odd && /run/some/odd_backup.sh |
Audio Broadcast(standby)Moon StatusPhase: 64.16%Illuminated: 81.47% Age (days): 18.95
Fri Jul 30 11:14:05 MDT 2010 |