Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Tried that.... no success

sales@rwb.com.au wrote:

mysqldump test | gzip > /tmp/mydb_`date '+ %d_%m_%y__%H-%M'`.sql.gz
bash: /tmp/mydb_`date '+ %d_%m_%y__%H-%M'`.sql.gz: ambiguous redirect

Well, it works for me, at least on command-line. I haven't tried that via "call".
sales@rwb.com.au

Tried that.... no success

mysqldump test | gzip > /tmp/mydb_`date '+ %d_%m_%y__%H-%M'`.sql.gz
bash: /tmp/mydb_`date '+ %d_%m_%y__%H-%M'`.sql.gz: ambiguous redirect
martin

Re: using call to produce dynamic file names

I'm not a linux guru :-) but you can try following:
call mysqldump mydb | gzip > /tmp/mydb_`date '+ %d_%m_%y__%H-%M'`.sql.gz
sales@rwb.com.au

using call to produce dynamic file names

Hi all,
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.
Something like:

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\
close
exit

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.

thanks
sam