Recently I wrote a simple little script to backup a directory to S3. My goal is to run daily, weekly and monthly backups the have different retention rules based on the frequency in S3.
Everything is working pretty well with one exception. My WEEKLY cron job runs every day. Here's the crontab:
0 3 1 * * /usr/s3_sync_dir /dropbox MONTHLY 0 2 2-31 * THU /usr/s3_sync_dir /dropbox WEEKLY 0 3 2-31 * * /usr/s3_sync_dir /dropbox DAILY
So the MONTHLY job runs at 3am on the 1st of every month. The WEEKLY should then run on Thursdays at 2am if it's not the 1st. And the DAILY just runs every day that's not the 1st. This online validator confirms that the WEEKLY should just run every Thursday.
Anyone have thoughts as to why my WEEKLY job runs every morning?
This is on Ubuntu 16.04.2 LTS.