Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Jun 2006
    Location
    Portugal
    Posts
    113
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default Run a command after a finished Backup

    Hi guys,

    I want to run a rsync command or sh file (as you wish) to backup all the data that's in the /backup dir after cpbackup has finished. Another thing I would ask for an adive of a good rsync -(strings) command. Because I'm a bit confused.

    Regards

  2. #2
    Member
    Join Date
    Mar 2006
    Posts
    1,215

    Default

    You would need to provide more detail for your task.

    Are you syncing to a different machine or other directory. Is the other machine on a lan etc etc..

    Provide more detail.

  3. #3
    Member
    Join Date
    Jul 2008
    Location
    India
    Posts
    14

    Lightbulb

    Hi,

    If you want you can run a script to take complete back up of all the accounts in your server and then rsync it to the destination server.For rysnc you can use the following syntax

    rsync --progress -e 'ssh -p portnumber' <source> <destination>

    eg:rsync --progress -e 'ssh -p 7277' /backup 192.168.0.150:/cpbackup

    Cheers

  4. #4
    Member
    Join Date
    Jun 2006
    Location
    Portugal
    Posts
    113
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Hi,

    The machine is in the LAN network. Connected with a 1gbit CrossOver cable. I want to edit "cpbackup" file to make him do a rsync command.

    regards

  5. #5
    Member brianoz's Avatar
    Join Date
    Mar 2004
    Location
    Melbourne, Australia
    Posts
    1,093
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    There may be a way to do it within cpbackup, but I'm not sure there is.

    One easy way to do it though is to add your second command onto the end of the cpbackup line in crontab.

    ie: crontab -e -- old line:
    Code:
    0 1 * * * /scripts/cpbackup
    -- new line:
    Code:
    0 1 * * * /scripts/cpbackup; /usr/local/bin/my_rsync

  6. #6
    d_t
    d_t is offline
    Member
    Join Date
    Sep 2003
    Location
    Bucharest
    Posts
    231

    Default

    Quote Originally Posted by brianoz View Post
    There may be a way to do it within cpbackup, but I'm not sure there is.
    No, any change in that file will be overwritten at next cpanel update.
    You can add any command in /scripts/postcpbackup Create it if does not exists and set execute permission.

Similar Threads & Tags
Similar threads

  1. Run shell command from WHM
    By yoachan in forum cPanel and WHM Discussions
    Replies: 9
    Last Post: 05-10-2011, 05:30 AM
  2. Run script from command line
    By nileshwarade in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 01-24-2006, 04:55 PM
  3. Run backups now command needed...
    By 3en in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-31-2004, 11:58 AM
  4. oops, please run a command for me
    By c9net in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 05-21-2004, 02:36 AM
  5. How to run unpkgacct from command line?
    By Shiekron2 in forum cPanel and WHM Discussions
    Replies: 9
    Last Post: 05-04-2004, 01:35 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube