Last active
November 3, 2016 20:28
-
-
Save MrityunjaiKumar/809c0e4f64e3d6c8a16b9a1e1aa2d480 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# * * * * * command to execute | |
# ┬ ┬ ┬ ┬ ┬ | |
# │ │ │ │ │ | |
# │ │ │ │ │ | |
# │ │ │ │ └───── day of week (0 - 7) (0 to 6 are Sunday to Saturday, or use names; 7 is Sunday, the same as 0) | |
# │ │ │ └────────── month (1 - 12) | |
# │ │ └─────────────── day of month (1 - 31) | |
# │ └──────────────────── hour (0 - 23) | |
# └───────────────────────── min (0 - 59) | |
crontab -e | |
crontab -l | |
@reboot python /path/script.py & | |
#!/usr/bin/env bash | |
cd ~/ | |
cd ~/scripts | |
sudo python targetPythonScript.py | |
cd ~/ | |
chmod 755 fifteenMinlauncher.sh | |
@reboot sh /path/fifteenMinlauncher.sh >/pathToLogFolder/fifteenMinlauncherCronlog.log 2>&1 | |
Examples include: | |
* * * * * command - runs every minute | |
30 * * * * command - runs every 30 minutes | |
30 8 * * 5 command - runs every Friday at 8:30am | |
*/15 * * * * [path/to/script] #every fifteen minutes | |
sudo service cron reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment