Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member dianaward's Avatar
    Join Date
    Dec 2002
    Location
    USA
    Posts
    102

    Default I need help modifying my backup script

    I have been using a script to daily, weekly and monthly ftp the automatic backups my web hosting servers to a different server for redundant backups. It has been working fine, but due to a couple of website hackings on my servers I have recently stopped allowing root login on them. The problem is that I am not very familiar with writing unix scripts and I'm not sure how to change my backup ftp scripts so that they will log into the receiving server as admin and then su root, then enter the root password. Can someone please help?
    Diana Ward
    http://aqualityhost.com
    Sanity calms, but madness is more interesting.
    <cite>-- John Russell </cite>
    That's why I'm a Web designer/host."
    <cite>-- Diana Ward</cite>

  2. #2
    Member dianaward's Avatar
    Join Date
    Dec 2002
    Location
    USA
    Posts
    102

    Default Help meeeeee?????

    I know many of you can write shell scripts. All I need is to know how the commands should look, I think....
    Diana Ward
    http://aqualityhost.com
    Sanity calms, but madness is more interesting.
    <cite>-- John Russell </cite>
    That's why I'm a Web designer/host."
    <cite>-- Diana Ward</cite>

  3. #3
    Member
    Join Date
    Apr 2004
    Posts
    31

    Default

    Interesting script - how could I do something similiar to this?
    // Gary

  4. #4
    Member dianaward's Avatar
    Join Date
    Dec 2002
    Location
    USA
    Posts
    102

    Default Here's the basic script:

    Script starts below:


    #!/usr/bin/expect -f

    set root_pass "xxxxxxxxx"
    set hostname "123.45.678.910"

    set folder "/backup/cpbackup/daily"

    spawn /usr/bin/scp -r $folder root@$hostname:/backup/daily
    sleep 3
    expect "password: "
    sleep 3
    send "$root_pass\r"
    interact

    Script ends. Put in /usr/bin/ and name whatever you'll remember. Chmod 755.

    Change root pass to the root password on the receiving server, hostname to the receiving IP, "set folder" to the location of the backup files on the sending server, and "/backup/daily to the location you want the files sent.

    I created an scpeweekly.sh and scpemonthly.sh to send those too. I set up cron jobs to do them automatically, but for some reason the crons don't usually work, so I just executed the scripts manually.

    Of course, now I can't use them until I find some help making the script login as admin and su root.
    Diana Ward
    http://aqualityhost.com
    Sanity calms, but madness is more interesting.
    <cite>-- John Russell </cite>
    That's why I'm a Web designer/host."
    <cite>-- Diana Ward</cite>

Similar Threads & Tags
Similar threads

  1. script to run after modifying an account
    By bmett in forum cPanel Developers
    Replies: 4
    Last Post: 02-25-2011, 07:26 PM
  2. Modifying Cpanel options/security from a script
    By greg_gti in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 11-04-2005, 06:46 PM
  3. Modifying cPanel login script?
    By kyfrow in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-04-2005, 04:46 AM
  4. Modifying Backup
    By Pryach in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 05-17-2005, 07:18 PM
  5. modifying wwwacct script
    By s3kk3y in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 06-20-2003, 01:07 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube