Client Center
 
 

Comentum Corp.

 
 

Creative Services

Interactive Multimedia Concept Marketing Broadband Technology
 
Comentum Development

 

:: COMPANY
:: CAREERS
:: CONTACT INFO
:: TERMS & PRIVACY

 

 


Backing up with rsync & crontab

Open terminal and type:
sudo tcsh

nano ~/backupscript

Type the below script. This checks to see if there is a backup drive: "/Volumes/Backup" connected

#!/bin/bash
if [ -d /Volumes/TinyDrive/Backup ]
then
rsync -a /Users/josh /Volumes/TinyDrive/Backup/josh
exit 0
else
exit 0
fi

More rsync examples:
rsync -a root@host.comentum.com:/home/ /Users/serverbackup/
rsync -a :/home/ /backup/serverhome/


chmod +x ~/backupscript

nano /etc/crontab

And add one of the following lines depending on your situation. This schedule the backup on 1am every day.

Remote Host Backup with linked PATH to mysqldump:
0 1 * * * mysqldump -h mysql.host.com -uusername -ppassword --opt database > /path/to/directory/filename.sql

Remote Host Backup:
0 1 * * * /usr/local/mysql/bin/mysqldump -h mysql.host.com -uusername -ppassword --opt database > /path/to/directory/filename.sql

Local Host mysql Backup:
0 1 * * * /usr/local/mysql/bin/mysqldump -uroot -ppassword --opt database > /path/to/directory/filename.sql

(There is no space between the -p and password or -u and username - replace root with a correct database username.)


Backing up MySQL Database using mysqldump & crontab

Open terminal and type:
sudo tcsh

pico /etc/crontab
or
nano /etc/crontab

And add one of the following lines depending on your situation. This schedule the backup on 1am every day.

Remote Host Backup with linked PATH to mysqldump:
0 1 * * * mysqldump -h mysql.host.com -uusername -ppassword --opt database > /path/to/directory/filename.sql

Remote Host Backup:
0 1 * * * /usr/local/mysql/bin/mysqldump -h mysql.host.com -uusername -ppassword --opt database > /path/to/directory/filename.sql

Local Host mysql Backup:
0 1 * * * /usr/local/mysql/bin/mysqldump -uroot -ppassword --opt database > /path/to/directory/filename.sql

(There is no space between the -p and password or -u and username - replace root with a correct database username.)








 

 

 

  Comentum Development

 

 

 

 




Call for more details

858-410-1500

 

Bernard Kohan © 2007 - 2008
Website Design and Development - San Diego, Chicago, Austin, Irvine, Los Angeles, Ft Lauderdale, Jacksonville
Website Database Development - San Diego, Chicago, Austin, Irvine, Los Angeles, Ft Lauderdale, Jacksonville
Website Design and Flash Animation - San Diego, Chicago, Austin, Irvine, Los Angeles, Ft Lauderdale, Jacksonville
Web Database Developers: PHP & MySQL Programmers
Custom Database Programmers: PHP & MySQL Developers
Database Design
PHP Programmers

 

  San Diego • Los Angeles • Chicago • 800-387-1920  


 

Comentum Corporation, Copyright © 1996-2008