Autobackup to FTP server

Discussion in 'Feature Requests' started by lano, Jan 16, 2008.

  1. lano

    lano Member

    It would be nice if Ispconfig could perform auto backup (data that are backing up in backup manager) to external ftp server. In backup manager you would check sites to backup, then select daily or weekly task and enter informations of ftp backup server... and happy Ispconfig users will be even more happy, knowing
    that data of our customers is in safe place :)

    Just a thought

    David

    p.s.:
    I am not a programer but, maybe someone could write some kind of plugin? Invoke cron or something? ...
     
  2. falko

    falko Super Moderator Howtoforge Staff

  3. lano

    lano Member

    This tool looks excellent, but it doesnt create mysql dumps, as Ispconfig backup manager does.
     
  4. goldstift

    goldstift New Member

    Mysql-Backup-script

    Hi,

    I'm currently using the following Shellskript to backup my MySQL-Databases:
    Code:
    #!/bin/bash
    # file: mysql_backup.sh
    # 20060810 AHE
    
    echo "`date +%F_%T`: Starting mysqldump...
    "
    user=root
    user_pw=THE_MYSQL_ROOT_PW
    backupDir="/backup/mysql/"
    
    DBS="$(mysql -u $user -p$user_pw -Bse 'show databases')"
    
    for db in $DBS
    do
            currDB=$db
            filename=$backupDir$db"_dump.sql"
            mysqldump --user=$user --password=$user_pw $db > $filename
    
    # Don't generate gzip files at the moment
    #        gzip -c $filename > $filename".gz"
    #        rm $filename
    done
    echo "`date +%F_%T`: Finished mysqldump...
    "
    
    You have to adjust the variables "user_pw" and "backupDir" of course.
    This scripts gets the list of all databases running in your mysql server and dumps them to simple DATABASENAME.sql files.

    You should run a "chmod 700 mysql_backup.sh" on the script to ensure that only the author may read it - except you want everyone to know your mysql root's pw ;-)

    Greets,
    Alex
     
  5. unclecameron

    unclecameron New Member

    Cool script, thanks :)

    I added a couple lines to make it put the backup time/date in the filename so I could avoid accidentally overwriting the dumps, I added:

    date="`date +%F_%T`"

    and changed

    filename=$backupDir$db"_dump.sql"

    to

    filename=$backupDir$db"_"$date"_dump.sql"
     
  6. falko

    falko Super Moderator Howtoforge Staff

Share This Page