Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Shell script for backup and restore


    Hi,

    I have requirement on shell scripting. I require scripts for the following
    1) Full backup(application and DB): tar all the files and database and copy them in the backup server
    2) incremental back up of files: backup of all the updated files after the last backup
    3) restoring of backup files: restore the backup files from the backup server to the application server

    Please help me in providing the scripts(.sh files) for the above backup and restore functionalities.

    Thanks in advance

  2. #2

  3. #3
    The simplest way to backup MySQL database is to use myqldump:

    Code:
    mysqldump --opt --quick -u $DBUSER -p$DBPASS $db > $BACKUP_DIR/mysql-$db-$DATEPREFIX.sql
    and then gzip it or compress it via pipe.


    I posted the example of incremental backup script to thread pointed above.

    To upload backup to FTP server you can use:

    Code:
    ncftpput -u $FTP_USER -p $FTP_PASSWORD $FTP_SERVER  / $BACKUP_FILE

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •