After setup cron don’t forget restart crond

To setup nano as default program
export VISUAL=nano; crontab -e

crontab -e

@reboot mail -s ‘PBX Rebooted’ [email protected]

crontab -e
12 10 * * 0 cat /root/.bash_history /history.txt

12 10 * * 0 mail -s 'PBX Hystory Attachment' -r [email protected] /history.txt

Explanation of Cron options

+---------------- minute (0 - 59)
| +------------- hour (0 - 23)
| | +---------- day of month (1 - 31)
| | | +------- month (1 - 12)
| | | | +---- day of week (0 - 6) (Sunday=0 or 7)
| | | | |
* * * * * command to be executed
26 8 * * *

!!!To create Executable Bash script please run this command!!!

chmod +x /var/www/bckp.sh

Cron Example of pro-wiki.com

30 20 * * * /var/www/backup.sh
systemctl restart crond

Leave a comment

Your email address will not be published. Required fields are marked *