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.

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:
    1
    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:
    16
    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
     
  3. rasilva

    rasilva Member

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

    ekhwan Active Member

    Joined:
    Aug 12, 2006
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    Is it Possible to add a cronjob without shell access, if yes how can this be done?
     
Loading...

Share This Page