I'm using a script that uses `call` to dump a database:
call mysqldump mydb | gzip > /tmp/mydb.sql.gz
this works just fine. But, what I would like is to call the file with a date/time tagged with it. e.g
call mysqldump mydb | gzip > /tmp/mydb_23-04-06_11-23am.sql.gz
of course the 23-04-06_11-23am part needs to be automated.
I can do this by calling a shell script e.g call foo.sh but I was wondering if there were any linux shell gurus who might be able to help me do it straight from the winscp call syntax.
option batch on
option confirm off
option transfer binary
call datevar=date '+ %d_%m_%y__%H-%M'
call mysqldump mydb | gzip > /tmp/mydb_$datevar.sql.gz
get /tmp/mydb_$datevar.sql.gz c:\backupfolder\
ANOTHER alternative would be to always dump it as the same name in /tmp then do a
`call rename samename namewithdynamicdate
then get it. But alas I can't do this other than in a .sh file , so a solution here is just as sufficient.