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!

Cron Job to backup one site

Discussion in 'General Discussion' started by rasilva, Jul 29, 2007.

  1. rasilva

    rasilva Member

    Joined:
    Mar 18, 2003
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    151
    Hello,

    Can anyone tell me if it's possible to create a cron job that backups one site (just one not the whole server) to the home directory of the account.

    This may sound strange but i need it to be accessible, via FTP, so a system i have in my office can go there and download it to my local server (installed at the office) once a day.

    As it is now, i can only download files.... that's why i would like to create a full backup (just like the ones cpanel does with mail, databases, files etc...).

    Thanks in advance. :)
     
  2. beehave

    beehave Well-Known Member

    Joined:
    Jun 26, 2005
    Messages:
    104
    Likes Received:
    0
    Trophy Points:
    166
    This script SHOULD do what you want. It uses /scripts/pkgacct to pack up account and then moves the gz file into the home directory of the account.

    Code:
    #!/bin/bash
    
    user='USERNAME'
    
    /scripts/pkgacct $user
    
    mv -f /home/cpmove-$user.tar.gz /home/$user/$user.tar.gz
    
    exit
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. rasilva

    rasilva Member

    Joined:
    Mar 18, 2003
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    151
    Thanks a lot ! Works like a charm ;)
     
  4. ekhwan

    ekhwan Active Member

    Joined:
    Aug 12, 2006
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    156
    Is it Possible to add a cronjob without shell access, if yes how can this be done?
     
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