Linux How to..

Linux How to ,Share Knowledge

TAG: Auto Backup Crontab User root Every Weeks time 04:00 a.m.

#Create Folder For Backup
mkdir /root/backup/

#Create Folder For Shell Scripts
mkdir /root/scripts/

#Create Shell Scripts File
vi /root/scripts/

crontab -l -u root > /root/backup/crontab-`date +%Y-%m-%d`

:wq! Save and Quit

#Chmod Permission file for Shell Scripts Allow User root – Read+Write+Execute
chmod 700 /root/scripts/

#Add Shell Scripts Run Every Weeks time 04:00 a.m. on crontab

crontab -e

input line below :
#backup crontab every weeks
0 4 * * 0 /bin/sh /root/scripts/

:wq! = save and quit


Comments are closed.