Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Backup to Remote Server

Discussion in 'General Discussion' started by MySundown, Jun 2, 2003.

  1. gundamz

    gundamz Well-Known Member

    Joined:
    Mar 27, 2002
    Messages:
    245
    Likes Received:
    0
    Trophy Points:
    316
    Your script will backup daily only ,right?

    Does it backup mySQL data too?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. dianaward

    dianaward Well-Known Member

    Joined:
    Dec 9, 2002
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    Twitter:
    Need help with error message

    Everything went fine until I tried to test. Here's what I got, what do I change?

    /bin/tar: Removing leading `/' from member names
    /usr/local/bin/ftpbackup: option requires an argument --
    ftpbackup -h host [-P port] -u userid [-p pw] [-d dir] [

    -h host ftp host name to connect to
    -P port port # to use (defaults to 21)
    -u userid account userid (defaults as anonymous)
    -p passwd password

    Other options:
    -x ftp debug messages to stderr
    -d dir Change working directory to dir
    -D Attempt to create directory, if necessary.

    --help Lists this info and exits.
    --version (or -V) Lists version info.

    Mode:
    -b filename Backup to remote filename from stdin
    -r filename Restore from remote filename tostdout
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. dianaward

    dianaward Well-Known Member

    Joined:
    Dec 9, 2002
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    Twitter:
    No help for the weary?

    Pleeeezzzze?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    168
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    We NFS mount a remote machine drive on the cpanel box as /home1 and let cpanel do a backup copy to that folder

    Pretty fast and easy to do a restore
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. dianaward

    dianaward Well-Known Member

    Joined:
    Dec 9, 2002
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    Twitter:
    But we need...

    to backup onto the backup drive in the same server, then have the files ftped also to another server as a fallback backup. That's what I assume this script will do. But nothing I try will work, so far.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    168
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    You could NFS mount your remote drive and simply do a cp -fr <path to backup> <path to remote drive> and do this via cron once a week or however often you want to do it

    or you can use rsync to transfer the files across
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. Lem0nHead

    Lem0nHead Well-Known Member

    Joined:
    Sep 2, 2003
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    156
    seens this ftpbackup file has some bug:

    root [/]# echo hey | /usr/local/bin/ftpbackup -x -h IP -u USERNAME -p PASSWORD -b a
    220-This computer system is for authorized users only. Individuals using this
    Unable to connect to IP port 21

    is it gets the 220 message (it's showing FTP messages because i setted -x flag), how didn't it get to connect?

    any suggestions?

    thanks

    -- Dave
     
  8. dianaward

    dianaward Well-Known Member

    Joined:
    Dec 9, 2002
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    Twitter:
    I finally found a solution that works for me

    At last, a tech support person sorted out a solution for my problem. It has been working great for the past week. This copies all the daily backups to another of my servers, daily via cron.

    Follow the steps as given below:
    1.SSH the server on which you want to setup the cron job.
    2.cd /usr/bin
    3.Create a file scpe.sh
    4.Copy the contents between the below lines to scpe.sh
    ==========
    #!/usr/bin/expect -f

    set root_pass "xxxxxxxxxxx"
    set hostname "123.45.678.910"

    set folder "/backup/cpbackup/daily"

    spawn /usr/bin/scp -r $folder root@$hostname:/backup/
    sleep 3
    expect "password: "
    sleep 3
    send "$root_pass\r"
    interact
    ===========
    6.chmod 755 scpe.sh.
    5.Setup a daily cronjob which calls the script. (ie. a file in cron.daily named backup.cron and containing the command:
    /usr/bin/scpe.sh )

    Note : REPLACE THE IP AND PASSWD IN THE SCRIPT WITH THE IP AND PASSWD AS THAT OF THE REMOTE SERVER.

    The script will copy the entire folder daily to the remote server's /backup/
    partition, and put it into a directory named daily.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. Lem0nHead

    Lem0nHead Well-Known Member

    Joined:
    Sep 2, 2003
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    156
    i got to make it work using ncftpput (it's almost the same thing as ftpbackup, but worked here)
     
  10. fuzzie

    fuzzie Well-Known Member

    Joined:
    Oct 12, 2002
    Messages:
    131
    Likes Received:
    0
    Trophy Points:
    166
    How do you do this with rsync?
     
  11. 1host

    1host Member

    Joined:
    Sep 3, 2002
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    151
    Hi all,

    I think it get with file backup1.tar.gz.

    What can I do if I need do backup from more than server to one server ( backup )

    Thank you very much.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. WebHostPro

    WebHostPro Well-Known Member PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,677
    Likes Received:
    22
    Trophy Points:
    318
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    Twitter:
    If you can do this with rcync then that would be a perfect solution.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. 1host

    1host Member

    Joined:
    Sep 3, 2002
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    151
    When I put this commend:

    cd /
    ./etc/cron.weekly/backup.pl

    the result message.

    Unable to connect to 70.84.156.??? port 21

    Could you tell me what is the solve?

    Thank you very much.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. vissa

    vissa Well-Known Member

    Joined:
    May 12, 2003
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    156
    Very nice little script and it works well! A few notes:

    The first time you run it you will manually have to answer "yes" on most servers.. From then on it's automatic.

    You may want to change "scp -r" to "scp -rpq".. That will preserve permissions/timestamps and also prevent output of the progress meter.

    -V

     
  15. WebHostPro

    WebHostPro Well-Known Member PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,677
    Likes Received:
    22
    Trophy Points:
    318
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    Twitter:
    Great, it works good.

    My thought is this, could there be a companion script that would find the existing files that are not on the main server and remove them from the back up server?

    Maybe a little script that can find files older then two weeks and delete them. Maybe even a simple cron job for those guys that are good with commands.

    One command to find files older then two weeks in multiple directories and remove them to a junk folder or permanently off the server.

    Anyone know how this could happen?

    Also rather then overwrite files that have not changed can we make this script only transfer changed files?

    Just putting thoughts out there, I think we are on to something great here.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. ianmarie

    ianmarie Well-Known Member

    Joined:
    Mar 27, 2006
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    156
    How to do an nfs mount?

    Is it possible to mount a remote server as an nfs mount - if that remote server only has eg sftp / ftp / ssh on it?

    Documentation anywhere?
     
  17. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    168
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    you have to have nfs installed and running on the backup box and then edit your web server /etc/fstab and both servers /etc/hosts.allow so the nfs client and portmapper on the local machine can access the nfs server and portmapper on the remote machine.

    google mount nfs share and you should be able to get enuf docs so you can setup the share as your needs require
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. ianmarie

    ianmarie Well-Known Member

    Joined:
    Mar 27, 2006
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    156
    Thanks Dave

    Fair enough - so I don't actually have that sort of privilege on the backup space; so looking at other alternatives. But thanks for the info; may experiment some more with it....

    cheers
     
  19. ebinfo

    ebinfo Active Member

    Joined:
    Oct 5, 2005
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    156
    i have a question, can you specify the port number?

    ie i am using a ftp server on my desktop, on port 2123 to avoid mass hits (it's on my desktop computer), however with the current WHM backup the port always gets removed when it does it's daily updates. which would force me to go in there daily to update the cpbackup script with the specific port, and then fire it up manually. which is a pain.

    what bugs me is that if you go on cPanel for one website and set a backup to be made, you can specify which remote port is to be used, but not in the main WHM which takes care of all the backups for the whole server.

    if you could provide a way to specify which remote port that could be used, i would just disabled WHM backup altogether and just use that one, which i hope would not be subject to daily rewrites by WHM updates
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice