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

cron job

  • 04-09-2004 11:24am
    #1
    Registered Users, Registered Users 2 Posts: 1,459 ✭✭✭


    hello can someone give me a cron job script for emailing a sql database to myself every day from my cPanel, on my server


Comments

  • Registered Users, Registered Users 2 Posts: 1,459 ✭✭✭Heathen


    do i make sence?


  • Registered Users, Registered Users 2 Posts: 3,889 ✭✭✭cgarvey


    do i make sence?

    Nope, but you do kinda make sense! ;)

    So this shell script will dump, db, tar/gzip it up, and mail it as an attachment to the specified address.. you'll probably want to handle errors a bit better.

    You can just put it in /etc/cron.daily
    #!/bin/sh
    
    cd /root
    mysqldump db_name > db.sql
    tar -zcf db.tgz db.sql
    uuencode db.tgz db.tgz | mail me@mydoamin.com
    rm db.sql
    rm db.tgz
    

    This script is assumed to run as root on a cPanel server (as root, by default, has mysql connection details stored in ~/.my.cnf)

    HTH
    .cg


Advertisement