Retrieve a file via ftps + mysql backup

This is a note to myself, so I remember later, since the syntax is a bit complex and you need several variable settings (they can also be set in ~/.lftp):

lftp -e "set net:timeout 10; set ssl:verify-certificate no; set ftp:ssl-protect-data true;get mydir/myfile.sql.gz; bye" -u myusername,mypassword ftp.myserver.com

You can use that to make automatic backups of a mysql database, by adding a line like this to your webhosts cron list:

/usr/bin/mysqldump -u myuser --password=mypassword databasename | /usr/bin/gzip >/home/user/htmldir/mydir/myfile.sql.gz