Cron job to fully backup wordpress automatically

If you’re using wordpress, chance are you’re using Updraft plugin for backup and restore purpose, but it doesn’t always working with automatic backup especially some host may disable wordpress cronjob. So it’s better to create a manual cronjob as following:

In the wordpress installation folder, create a backup.php with this content:


define('DOING_CRON', true);

Now create a cron job to run this file eg at 2AM everyday:

crontab -e
0 2 * * * /bin/php /var/www/public_html/wordpress_website/backup.php
esc :wq Enter

Add to my src(0)

No account yet? Register