Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Want to use crontab to set dbase backup

  • 20-01-2006 12:07pm
    #1
    Registered Users, Registered Users 2 Posts: 461 ✭✭


    Hi there,
    I have entered the world of cron jobs and am less than experienced!

    I want to use crontab manager in my webhosting control panel to automate dbase backups...

    I think this should work for a database backup:

    In a db_backup.pl file: run from the crontab manager at a specific time.

    /usr/bin/nice -20 /usr/bin/mysqldump -q --hdbhost.com --user=username --password=password dbname /usr/www/users/ourname/backup/database_name _`date "+%Y%m%d"`.sql ; cd /usr/www/users/ourname/backup ; /usr/bin/find *.sql -mtime +7 -delete
    >/dev/null 2>&1

    ##comments###
    # hostprovider want us to nice the task with val 10+
    # -q to avoid exceeding memory lims for large tables
    # host user and pass and dbname provided
    # output to database_name with date.sql
    # change dir to the backup folder
    # delete any .sql older than 7 days
    #If any output is produced by a command executed from a crontab, the cron daemon will normally email the user that output.
    #thus >/dev/null 2>&1
    #
    #could change dir to a success_email.txt and send that email to me@myhost.com
    #not sure of the syntax to do this
    #how can we find out about errors?

    I would value input from anyone who is familiar with this task.
    I'd love a report emailed to me of success / fail etc

    Cheers


Advertisement