Activity Stream
48,167 MEMBERS
6942 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 4 of 4
  1.     
    #1
    Member
    Website's:
    bypassx.com

    Default Anybody knows a good script to backup files and db and upload to remote ftp?

    I?m searching for a script that backups mysql database and files of a folder and upload them to my remote server using ftp. With this solution i want to have a daily backup at another server, which i can restore very fast if my main VPS goes down.

    At the moment i found this: http://www.cyberciti.biz/tips/how-to...matically.html

    I still have to test it, if you know any other good alternative reply with it.

    Thanks in advance.
    Zeokat Reviewed by Zeokat on . Anybody knows a good script to backup files and db and upload to remote ftp? I?m searching for a script that backups mysql database and files of a folder and upload them to my remote server using ftp. With this solution i want to have a daily backup at another server, which i can restore very fast if my main VPS goes down. At the moment i found this: http://www.cyberciti.biz/tips/how-to-backup-mysql-databases-web-server-files-to-a-ftp-server-automatically.html I still have to test it, if you know any other good alternative reply with it. Thanks in advance. Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    yeah i am using similar script but a simpler one using only few lines
    http://www.besthostingforums.com/48-...sh-script.html

  4.     
    #3
    Member
    Website's:
    bypassx.com
    Thanks masterbator, something simple twice better

    It can be improved backuping files too.

    ---------- Post added at 07:30 PM ---------- Previous post was at 04:31 PM ----------

    Well... i modified the code provided by masterbator to adjust to my needs and correct some issues on my CentOS 5 x64 machine, fixes:

    - Tar shows a warning for use absolute paths (the files are compressed Ok anyway, but i not love see warning messages so i decied to fix them).

    - Changed ".tgz" extension of compressed files to ".tar.gz", both are equivalent, correct and working extensions but i always used ".tar.gz" and not give problems unless you go to a very very very old OS that not allows more than one point and more than three letters into a extension (MS-DOS for example).

    - Changed "-" with "_", since can cause issues have "-" char into filenames.

    - Ftp client on my CentOS 5 x64 (using same code as masterbator) result in upload files corrupted to my remote server, then i changed ftp to ncftp (installed by default on my CentOS 5 x64). I?m using into remote server vsftpd as ftp server/daemon.

    - I use /tmp folder as temporary folder to create backups and delete them, seems a safer location to play with command "rm -rf".

    - Line "rm -rf /your/path/*" is a little hardcore for me, i used prefix namefile, wildcard "*" and file extension, less hardcore.

    - Added support to backup files of my public_html folder.

    - Added support to upload the compressed and uncompressed database backup (i?m paranoic, but with a safe backup in my hands ).

    The code (remember to edit script with your paths and user/pass, the blue text):

    Code: 
    #!/bin/bash
    ### Dump mysql database and compress it ###
    echo Starting Database Backup
    mysqldump -uYour_db_User -pYour_db_password -hlocalhost Your_db > /tmp/sql_backup_`date +%d%m%y`.sql
    cd /tmp
    tar -zcf sql_zipped_backup_`date +%d%m%y`.tar.gz sql_backup_*.sql
    echo Database Backup Completed
    
    ### Compress files ###
    echo Starting Files Backup
    cd /
    tar -zcf /tmp/filesbackup_`date +%d%m%y`.tar.gz home/www/web.com/public_html
    echo Files Backup Completed
    
    ### Upload to remote ftp ###
    cd /tmp
    HOST='100.200.200.105'
    USER='ftp_user'
    PASSWD='ftp_pass'
    ncftp -u"$USER" -p"$PASSWD" $HOST<<EOF
    put sql_zipped_backup_*.tar.gz
    put filesbackup_*.tar.gz
    put sql_backup_*.sql
    quit
    EOF
    
    ### Delete backups ###
    echo Start Cleaning Backup Files
    cd /tmp
    rm -rf sql_zipped_backup_*.tar.gz
    rm -rf sql_backup_*.sql
    rm -rf filesbackup_*.tar.gz
    echo Cleaning Backup Files Completed
    
    exit 0
    Enjoy.

  5.     
    #4
    Member
    Website's:
    EastsideHosting.com MediaONAIR.com ImgWiz.com cPadmin.net EastsidePCWorks.com HostedTalk.com
    I'm planning on using this for a backup system, supports almost everything.

    https://github.com/meskyanichi/backup

    Even Amazon.

    Install Ruby

    $ sudo yum groupinstall 'Development Tools'
    $ sudo yum install readline-devel
    $ cd /usr/local/src
    $ wget ftp://ftp.ruby-lang.org/pub/ruby/1.9....1-p376.tar.gz
    $ tar xzvf ruby-1.9.1-p376.tar.gz
    $ cd ruby-1.9.1-p376
    $ ./configure && make
    $ sudo make install
    Source: http://mjijackson.com/2010/02/ruby-1.9-centos-5

    Install Backup

    gem install backup
    Source: https://rubygems.org/gems/backup

    or use a Bash Script like supplied.

    Regards,
    Cory
    EastsideHosting - (Web Hosting, Proxy Hosting, Reseller Program)
    MediaONAIR - (SHOUTcast Servers, ICEcast Servers, Reseller Program)
    Server Administrator - (Dedicated Servers, VPS Management, One Time Services)
    ImgWiz - (Free Image Hosting)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 2nd May 2012, 12:11 PM
  2. [How to] STOP remote upload of my files?
    By jokerit in forum File Host Discussion
    Replies: 6
    Last Post: 10th Dec 2011, 11:22 AM
  3. Remote upload files from Errotica-Archives
    By BrambleBramley in forum File Host Discussion
    Replies: 0
    Last Post: 15th Aug 2011, 06:26 AM
  4. multiupload.com (multihosting upload files) and remote uploads too
    By liberiangirl in forum File Host Discussion
    Replies: 8
    Last Post: 9th May 2011, 06:10 PM
  5. How do I remote upload files from seedbox to RL
    By Nithin in forum Technical Help Desk Support
    Replies: 8
    Last Post: 7th Jan 2010, 09:00 AM

Tags for this Thread

BE SOCIAL