Schedule cron job Schedule cron job to take back up of database. Ste… SCHEDULE CRON JOB TO TAKE BACK UP OF DATABASE. Step 1: Go to schedule cron job option on your server. E.g. In textdrive go system>scheduled cron job
Step 2: Create on shell file to run command to take backup of database.
e. g. daily_backup.sh
Paste this commands in daily_backup.sh file.
#!/bin/sh
/usr/local/bin/mysqldump –opt –skip-add-locks database_name –user=username –password=password > /users/home/username/backups/file_name_date “+%Y-%m-%d”.sql
cd /users/home/username/backups/
/usr/bin/find *.sql -mtime +7 –delete
Keep this file in /users/home/username/script/ Step 3: Select create a new scheduled cron job option.
Write in command field
/bin/sh /users/home/username/script/daily_backup.sh
Step 4: you can select option for when to execute select simple schedule and select daily option from drop down list.
Step 5: Save cron job.