Newbi with scripting synchronize or get i have a doubt

Advertisement

SamSmall
Joined:
Posts:
1
Location:
France

Newbi with scripting synchronize or get i have a doubt

hie all, iput my context:

i have a windows server where i have set a task scheduled to start get every one hour, i retrieve log file from a remote server (unix).

i use synchronize option before but i encounter an issue because i can't delete file after transfer only 'get' can do that.

so someone can help me to automate this script without alert.

task scheduled:

"C:\Program Files\WinSCP\winscp.Exe" /console netreport@mrs-ix-00002.xxxxxxx.com /privatekey="D:\Sources\NetReport_New_PPK.ppk" /script="D:\script\Script_SFTP_SG1.txt"

Script_SFTP_SG1.txt

cd /prd/proxy/netreport/ProxySG1
get -delete *.log "D:\Applications\Netreport\Logs\Engine\FlatFile\Proxy SG1\"
exit

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: Newbi with scripting synchronize or get i have a doubt

Sorry, I do not understand that is it that you want to do that WinSCP cannot do.

Reply with quote

Sokoban
Joined:
Posts:
5
Location:
Trondheim

Re: Newbi with scripting synchronize or get i have a doubt

SamSmall wrote:

hie all, iput my context:

i have a windows server where i have set a task scheduled to start get every one hour, i retrieve log file from a remote server (unix).

i use synchronize option before but i encounter an issue because i can't delete file after transfer only 'get' can do that.

so someone can help me to automate this script without alert.

task scheduled:

"C:\Program Files\WinSCP\winscp.Exe" /console netreport@mrs-ix-00002.xxxxxxx.com /privatekey="D:\Sources\NetReport_New_PPK.ppk" /script="D:\script\Script_SFTP_SG1.txt"

Script_SFTP_SG1.txt

cd /prd/proxy/netreport/ProxySG1
get -delete *.log "D:\Applications\Netreport\Logs\Engine\FlatFile\Proxy SG1\"
exit

Do you have try with RM? --> https://winscp.net/eng/docs/scriptcommand_rm
//Sokoban

Reply with quote

Advertisement

You can post new topics in this forum