How to move phpmyadmin on scheduled time using cronjob

Posted by

Step 1: Create a script file where write the move command

touch opt/DO-NOT-TOUCH/script/weekly-site-backup.sh

Write command

#/opt/lampp/lampp stop
mv /opt/lampp/phpmyadmin /opt/lampp/save-phpmyadmin.sh
#/opt/lampp/lampp restart

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 time a script file

10 * * * * /opt/DO-NOT-TOUCH/script/save-phpmyadmin.sh >> /var/log/weekly-site-backup.log 2>&1

Step 5: Script is executable

sudo chmod +x /opt/DO-NOT-TOUCH/script/save-phpmyadmin.sh
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x