1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Welcome to GadgetBit!

We are a community of technology enthusiats.

If you are already a registered member then you can login here

If you are new to the site then why not join up? It will only take a couple of minutes to register, by doing so all adverts will be removed from the site. You can register here or you can use your Facebook or Twitter account.

Backup your phpBB filesystem using cron job

By Creaky · Oct 10, 2015 ·
  1. Creaky
    Backing up your phpBB file system using cPanel & cron

    The following will enable you to backup your phpBB file system using a cron job that will run at the time specified by you. Although this works for on my server it would be advisable to check with your host to make sure this will work on your sever. This is based on cPanel Accelerated 2.
    1. Log in to your cPanel account[/*]
    2. Navigate to the Advanced section and select Cron jobs[/*]
    3. Cron email � You can enter an email address here to receive a notification every time your cron job runs.[/*]
    4. Add New Cron Job[/*]
    5. Common Settings. This contains the most common time settings for the cron job, they include every minute, every 5 minutes, once an hour and a few more. Simply click on the list and select the time needed, the job will run at the selected time.[/*]
    6. If the period required is not on the list use the fields underneath to customise when the job should run. The available settings are Minute, Hour, Day, Month & Weekday. You can enter the relevant details in the box or select it from the drop down list.[/*]
    7. The next field is the place to enter the actual Command, this is what is going to be run at the specified time. The command we will be using is as follows[/*]


    Code:
    date='date -I' ; tar -cf /home/gadgetbi/public_html/BACKUPDIR/backup_$date.tgz  /home/gadgetbi/public_html/forum
    Command explanation
    date='date -I' - We start by setting the date variable, this will return the current date using the format yyyy_mm_dd

    tar -cf /home/gadgetbi/public_html/BACKUPDIR/backup_$date.tgz - Next comes the tar command, this is what compresses the backup. You will need to change the path to the location you wish to store the backup. The backup will be called backup_2011-02-25 and will be a TAR compressed file.

    /home/gadgetbi/public_html/forum - This is the folder you wish to backup, again change the path to match your setup.

    Once the above has finished running you can use your FTP client and download the backup to your own PC.

    Share This Article