step1: create a script file where write move command
touch opt/DO-NOT-TOUCH/script/weekly-site-backup.sh
write command
cd /opt/DO-NOT-TOUCH/backup
tar -cvf htdocs-wizbrand-$(date +"%d-%m-%Y").tar /opt/lampp/htdocs
step2: text editor to allow you to edit the crontab file (which contains scheduled tasks)
export EDITOR=vi
step3: open cron file
crontab -e
step 4: schedule a script file
0 21 * * SUN /opt/DO-NOT-TOUCH/script/weekly-site-backup.sh >> /var/log/weekly-site-backup.log 2>&1
Explanation
Top comments (0)