FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Cron Jobs (AutoBackup for all MYSQL databases every 24h)





phx777
this should work right?

Code:

DBPASS=pass
DBUSER=user
EMAIL="me@my.net"
FILENAME=MySQL

mysqldump -u $DBUSER -p$DBPASS --all-databases > backup.sql
gzip backup.sql
DATE=`date +%Y%m%d` ; mv backup.sql.gz $FILENAME-backup-$DATE.sql.gz
echo 'Blog Name:Your mySQL Backup is attached' | mutt -a $FILENAME-backup-$DATE.sql.gz $EMAIL -s "MySQL Backup"
rm $FILENAME-backup-$DATE.sql.gz


i feel like installing linux again just so i can fool around in konsole with transparent background Razz
phx777
but let me guess, mutt isnt installed on the server? Razz
does anyone have any good idea how i could send myself my backup to mail after i store it on server...
kv
Easy! Use php mail() function. In the php.net mail manual, there is a utility class to send attachments posted by somebody.

http://us2.php.net/function.mail
n0obie4life
Please, not every 24 hours. Maybe once a week..!

http://www.phpbb.com/kb/article.php?article_id=123

Try reading that (it's the phpbb website, but if you use a little bit of brains, it works for all databases)
Aelita
haha I guess if you just freaked about the once a day saving it's not a good idea to save every 6 hours huh...? Lol okay okay i wont... AND DON"T BOTHER CHECKING I HAVEN'T SET IT UP YET Razz *Runs to disable...* J/K
Related topics
cron jobs
Help me to Import mysql databases from web into home pc !
[RESOLVED] cron jobs
Cron Jobs
cron jobs?
PHP script installation for $4 or FRIH$ 30 (Worth $1000)
how do I auto backup using cron jobs
Question: PHP scripting + cron jobs
Cron jobs (Server 2)
Cron Jobs
using cron jobs and scp to automate backups
Cron jobs and PHP?
Cron jobs
Has anyone installed Moodle successfully?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.