Left Quote    A clever person solves a problem. A wise person avoids it.
- Einstein    
Right Quote
[login] | [Register]
Forum Index » PHP and mySQL » Viewing Topic and Replies
Post Reply

        Viewing Topic: php backup script
  This user is offline  peaderfi
  Subject: "php backup script" Posted: @ 2:37 pm on Dec 28 2007   
Member #: 1457
Rank: user - (0)
Since: 06/10/14
Posts: 0

Hey all,

I've created a backup script to backup my database but i need to convert it to php (which i am lacking in) so any help would be appriciated)

here's the code

#============= =============== =============== ===
#Save the script below as
#============== =============== =============== ==


  1. Script Created by xxx
  2. Las t edited 3/5/07 by xxx
# Script Function:
    This bash script backups up the "DB Name" and "DBName&qu ot; db everyday at 8am & 11pm with a file name time stamp and tar.gz zips the file.
  1. T he "DBName&qu ot; db will be saved in /backups/databa se_backups/DBNa me/
  2. The "DBName&qu ot; db will be stored in /backups/databa se_backups/DBNa me/
  3. Db backups older than 30 days will be deleted.
  4. #[Changes Directory]
    cd /backups/

    #[Old DB Deletion Script]
    find /backups/databa se_backups/DBNa me-name "*.tar.gz& quot; -mtime +30 -exec rm -f {} \;

    #[Stamps the file name with a date]
    TIMESTAMP=`date +%m-%d-%y-%H%M`

    #[DB Backup Scripts]
    1. "DBname&q uot;
    H OST=localhost DBNAME="DB Name"
    USER="DBus ername"
    PASSWORD=" DBpassword" ;
    DUMP_PATH=/home /accountname/ba ckups/database_ backups/DBname< br /> #mysqldump --opt -c -e -Q -h$HOST -u$USER -p$PASSWORD $DBNAME > $DBNAME.sql
    #tar -czpf $DUMP_PATH/$DBN AME.$TIMESTAMP. tar.gz $DBNAME.sql
    #rm -f $DBNAME.sql

    #============== =============== ==========
    #============== =============== ==========

    Viewed: 2,780 Times | Reply to This | To top
Viewing Page: 1 of 1

You must be logged in to post on the forums. Login or Register

"" Copyright © 2002-2021; All rights lefted, all lefts righted.
Privacy Policy