rm works on command lin but not in script!

Advertisement

ebakx
Joined:
Posts:
2
Location:
Belgium

rm works on command lin but not in script!

I am using this script to transfer a file and delete the source file.
The result is a perfect tranfer, but removing the source doen't work.
After checking the forum, I tryed using the latest version, checking the user (root) and the permissions, using "get -delete" al without succes.
Checking the log (attached) it seems as if after the succesfull transfer, winspc closes, discarting any statements after the "get". I tried adding a "echo" or even repeating the same "get" statement, they don't show in the log.

Executing "rm *txt" from the command line works perfect!

What am I missing? Thanks for helping!!

********************************
# USAGE: C:\Program Files (x86)\WinSCP>winscp.com /script=ScpScript2.txt
# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect
open scp://root:stiff14tree@192.168.0.184:22/www/verwarming
# Download file to the local directory
get -delete *.txt c:\Users\Erich\MCVLogs\DataTemp\
rm *.txt
# Disconnect
close
# Exit WinSCP
exit

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: rm works on command lin but not in script!

You are obviously executing a different script than the one you have posted.

> 2014-12-21 15:15:56.843 Script: option batch abort
...
> 2014-12-21 15:15:56.843 Script: option confirm off
...
> 2014-12-21 15:15:56.843 Script: open scp://root:***@192.168.0.184:22/www/verwarming
...
> 2014-12-21 15:15:59.673 Script: get *.txt c:\Users\Erich\MCVLogs\DataTemp\
...
> 2014-12-21 15:15:59.733 Script: close

Reply with quote

Advertisement

You can post new topics in this forum