phpBB backup mod :: add date
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4127
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
Read this thread for more phpbb backup techniques, including a work around for the phpbb restore problem [won't restore backup files larger than 3-5 mB]. Make sure to use the gzip option on backups, that cuts the size down to about 1/10 of the non gzipped version.

This one is very simple. It simply makes the saved backup file named after yoursite and today's date, concatenated:
Open:
/forums/admin/admin_db_utilities.php
Change this:
:: Code ::

if($do_gzip_compress)
         {
            @ob_start();
            @ob_implicit_flush(0);
            header("Content-Type: application/x-gzip;    
            name=\"phpbb_db_backup.sql.gz\"");
            header("Content-disposition: attachment;
            filename=phpbb_db_backup.sql.gz");
         }
         else
         {
            header("Content-Type: text/x-delimtext;
            name=\"phpbb_db_backup.sql\"");
            header("Content-disposition: attachment;
            filename=phpbb_db_backup.sql");
         }


to this [note, make yoursite into whatever you want it to say]:
:: Code ::

if($do_gzip_compress)
         {
            @ob_start();
            @ob_implicit_flush(0);
            header("Content-Type: application/x-gzip;
            name=\"phpbb_yoursite_" . date("y-m-d") . ".sql.gz\"");
            header("Content-disposition: attachment;
            filename=phpbb_yoursite_" . date("y-m-d") . ".sql.gz");
         }
         else
         {
            header("Content-Type: text/x-delimtext;
            name=\"phpbb_yoursite_" . date("y-m-d").".sql\"");
            header("Content-disposition: attachment;
            filename=phpbb_yoursite_" . date("y-m-d").".sql");
         }

Save and upload file, next time you do a native phpBB database backup, the file name will be unique, and you won't overwrite your last backup. Simple mod, takes a minute.

The resulting file name will look like this, say you are calling yoursite: xra:
:: Code ::

phpbb_xra_04-12-31.sql

No mixing it up, you know when the file was made right away, and it won't ever overwrite another backup.

We'll be looking into automating this mod so you can run it with crontab in the future, this is just the first step
Back to top
Display posts from previous:   

All times are GMT - 8 Hours