cron job setup

Discussion in 'Site & Server Administration' started by mattr2110, Apr 12, 2006.

  1. #1
    I found this script on another board that is used to backup their database. I have cron job icon in my cpanel but don't have a clue on how to set this up. Please help.

    1 #!/bin/sh
    2 BACKUPPATH='/home/progster/backup'
    3 PASSWD='xxxxxxxx'
    4 DATE=`date +%Y%m%d`
    5 NEWNAME=mgeventDB-$DATE.sql
    6 cd $BACKUPPATH
    7 mysqldump -u mgevent --password=$PASSWD --opt mgevent > $BACKUPPATH/$NEWNAME
    8 bzip2 $NEWNAME
    9 $HOME/Documents/scripts/mailfiles -t -s "mgevent weekly database backup" -b $BACKUPPATH/$NEWNAME.bz2 < /dev/null
    10 cd
     
    mattr2110, Apr 12, 2006 IP
  2. forkqueue

    forkqueue Guest

    Messages:
    401
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #2
    That's a shell script. Write it to your home directory, then add a cron to call it.
     
    forkqueue, Apr 12, 2006 IP
  3. mattr2110

    mattr2110 Active Member

    Messages:
    323
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Do I save it as .sh file? Also is my home drive something like www/domainname/
     
    mattr2110, Apr 12, 2006 IP