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

Author Message
Farnsworth

Guest


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):
Code:

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 :
Code:

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 ??
Farnsworth

Guest


Hi all !

In fact, this was explained in the FAQ Confused

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 ! Mr. Green
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License