Automation: Unable to transfert files via .bat file and cron

Advertisement

Farnsworth
Guest

Automation: Unable to transfert files via .bat file and cron

Hi everyone,

Here is my problem : I've made a script to automate the backup of my database. Here is what it looks like (bdd_backup.bat):
mysqldump -u user --password=pass --add-locks --complete-insert --extended-insert --opt --result-file=backup.sql myDataBase
 
winscp3.com  /script=%script_name%


And here is the code of the winscp3 script :
option batch on
option confirm off
open user@domain.com
cd backup_dir
option transfer binary
put backup.sql
close
exit


Everything works fine while I call bdd_backup.bat from the command line.

The problem comes when I call this .bat from cron. the 'mysqldump' is OK, but nothing is send via winscp3...

Here is my crontab :
* * * * * bddbackup.bat

Any Idea ??

Reply with quote

Advertisement

Farnsworth
Guest

It works !

Hi all !

In fact, this was explained in the FAQ :?

However, if you don't want to use .ini file, you have to :

-- Go to the Windows services
-- Find your task scheduler in the list (Cron service in my case)
-- Properties
-- Connexion
-- Select the username/pass of the windows account you use with WinSCP

Hope this help ! :mrgreen:

Reply with quote

Advertisement

You can post new topics in this forum