The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How do I backup the Puplic_html folder using a corn job ?

Discussion in 'Data Protection' started by mac99, Nov 29, 2006.

  1. mac99

    mac99 Member

    Joined:
    Nov 29, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I would like to backup only the folder puplic_html using a corn job, so what should I type in the command line ??

    I really appreciate it if someone replied .

    Thanks
     
  2. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    867
    Likes Received:
    9
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Code:
    rsync -auv /home/user_name/public_html /backup-destination
     
  3. mac99

    mac99 Member

    Joined:
    Nov 29, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Really thanks a lot,

    But this command synchronizes folders ( puplic_html, and distention folder ), I wanted to zip the puplic_html for a backup using corntab.

    So, would you please help me with this command.

    Thanks
     
  4. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    867
    Likes Received:
    9
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Try this then:
    Code:
    cp -r /home/user/public_html  /destination  | gzip -r /destination/public_html
     
    #4 kernow, Nov 29, 2006
    Last edited: Nov 29, 2006
  5. mac99

    mac99 Member

    Joined:
    Nov 29, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    after a long search i found this line, and it worked,

    tar -czf /home/user/distenation/public_html.gz.tar /home/user/public_html

    also i could use tar - cvf command, for a public_html.tar backup.

    but i'll try your line.

    thanks a lot
     
  6. mctDarren

    mctDarren Well-Known Member

    Joined:
    Jan 6, 2004
    Messages:
    664
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    New Jersey
    cPanel Access Level:
    Root Administrator
    corn job sounds obscene... sorry, just made me laugh alot for some reason. Keep in mind with this cron job that you will be taking up alot of space within the users accounts. Be careful not to put people over their limit. :)
     
  7. mac99

    mac99 Member

    Joined:
    Nov 29, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    I thought the same, but when I tried, I noticed that it overwrites the existing file.

    So, there is no fear to lose a lot of space.

    Thanks for that notice
     
  8. randomuser

    randomuser Well-Known Member

    Joined:
    Jun 25, 2005
    Messages:
    147
    Likes Received:
    0
    Trophy Points:
    16
    You and me both :D
     
Loading...

Share This Page