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!

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:
    151
    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:
    920
    Likes Received:
    13
    Trophy Points:
    168
    cPanel Access Level:
    Root Administrator
    Code:
    rsync -auv /home/user_name/public_html /backup-destination
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. mac99

    mac99 Member

    Joined:
    Nov 29, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    151
    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:
    920
    Likes Received:
    13
    Trophy Points:
    168
    cPanel Access Level:
    Root Administrator
    Try this then:
    Code:
    cp -r /home/user/public_html  /destination  | gzip -r /destination/public_html
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #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:
    151
    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:
    3
    Trophy Points:
    168
    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:
    151
    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:
    166
    You and me both :D
     
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