Backup MySQL Vtiger Database and compress it with zip

Here is a one-liner to backup your VTiger database, give it a timestamp and zip it.

export TMPDATE=$(date +%Y%m%d-%H%M); mysqldump -p vtigercrm50 > $TMPDATE"_vtigercrm50.sql" ; zip $TMPDATE"_vtigercrm50.sql.zip" $TMPDATE"_vtigercrm50.sql" ; rm $TMPDATE"_vtigercrm50.sql"

Some explanation:

vtigercrm50 = YOUR V-TIGER DATABASE NAME

Create a timestamp and save it in a variabel named TMPDATE

export TMPDATE=$(date +%Y%m%d-%H%M)

Dump the database and give is a name with the timestamp

mysqldump -p vtigercrm50 > $TMPDATE"_vtigercrm50.sql"

Zip the sql file

zip $TMPDATE"_vtigercrm50.sql.zip" $TMPDATE"_vtigercrm50.sql"

Delete the sql file

rm $TMPDATE"_vtigercrm50.sql"

Al whats left is a compressed dump of the vtiger database named YYYMMDD-HHMM_vtigercrm50.sql.zip (Where YYMMDD-HHMM is the current date and time)

Reply
The content of this field is kept private and will not be shown publicly.
CAPTCHA
Deze vraag is om te controleren of u een persoon bent. Di is om spam berichten tegen te gaan.