Skip to content

Instantly share code, notes, and snippets.

@Danack
Created November 18, 2013 20:43
Show Gist options
  • Save Danack/7534959 to your computer and use it in GitHub Desktop.
Save Danack/7534959 to your computer and use it in GitHub Desktop.
Crontab setup.
#!/bin/bash
#m: minute of the day, from 0 to 59
#h: hour of the day, from 0 to 23
#dom: day of month, from 1 to 31
#Month
#dow: day of week, from 1 to 7
#user: user your cron job should run as
#command: command or script that should run
echo "MAILTO=\"[email protected]\"" | crontab -u intahwebz -
directory="/home/intahwebz/current/tools/amazon/"
command="cd $directory && sh backupSQLToS3.sh"
job="15 1 */2 * * $command"
cat <(fgrep -i -v "$command" <(crontab -u intahwebz -l)) <(echo "$job") | crontab -u intahwebz -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment