Share this page : facebooktwitterlinkedinmailfacebooktwitterlinkedinmail

Before we do anything about this backup, we’d better understand the parameters well.

First we should understand how does the backup work in GUI, On windows, we can setup the backup in the MySQL administrator > Backup. Setup the Backup Project name, Backup target folder, schedule name, save it. Then you can go to “Scheduled Tasks” (win2003) or “Task Scheduler”(Win 2012) find the schedule with the same schedule name. If we right click it and see the properties, you can find the command after the Run:

“C:\Program Files\MySQL\MySQL Administrator 1.1\MySQLAdministrator.exe” “-UDC:\Documents and Settings\eadmin\Application Data\MySQL\” “-cBSN” “-bpBSL POD” “-btP:\” “-bxBSL-POD”

  • The “-bpBSL POD” means Backup Project named “BSL POD“, which can be found in Backup Project tab, after the General tag.
  • The “-btP:\” means Backup Target folder is “P:\
  • The “-bxBSL-POD” means the Backup Schedule named “BSL-POD”

 

7zip command:

Here we will use the very basic command to compress the sql file:

7z a -tzip sqlXXXX_XXX.zip XXXX_XXX.sql

More about the zip command: check here.

 

Duplicati:

Duplicati command line script:

Environment:

$LOCATION='<location>' # EU, for example.
$PASSPHRASE='<passphrase>'
$AWS_KEY='<access_key>'
$AWS_SECRET='<secret_key>'
$S3_BUCKET='<bucket_name>'
$S3_RRS='--s3-use-rrs' # use reduced replication for backup
$DEBUG='--debug-output --log-level=Profiling' # verbosity to the max!!!1one
$DIR='<path>' # /Users/username/Documents/, for example.

Backup:

Duplicati.CommandLine.exe backup \
 --passphrase=$PASSPHRASE \
 --aws_access_key_id=$AWS_KEY \
 --aws_secret_access_key=$AWS_SECRET \
 --s3-location-constraint=$LOC \
 --aes-encryption-dont-allow-fallback=true \
 $DIR \
 s3://$S3_BUCKET/$DIR
 
# Obviously the S3 DIR target can be tweaked; this is just a simple example.
# If RRS is acceptable, add $S3_RRS in the options list.

Restore:

Duplicati.CommandLine.exe restore \
 --passphrase=$PASSPHRASE \
 --aws_access_key_id=$AWS_KEY \
 --aws_secret_access_key=$AWS_SECRET \
 s3://$S3_BUCKET/$DIR \
 $DIR

 

Reference

 

Duplicati Online help