Topic "MV COMMAND"

Author Message
LICE

Guest


I have a script with mv to rename a *.file to 1 and it runs fine when I am in the winscp> prompt but when I call a script it fails to rename the file.

Code:
cd /remotefolder/
put -filemask=>8K;|>1D; *.bin /remotefolder/
rm 1
mv *.bin 1


Do I need to call the full path?
Code:
mv /remotefolder/*.bin /remotefolder/1
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25966
Location: Prague, Czechia
Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, use /log=path_to_log_file command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.
LICE
[View user's profile]

Joined: 2017-04-19
Posts: 1
I am just removing the old 1 and rename %random%.file to 1. Should I try "rename" alias? Could it be the * in the mv command might expect more that one file and I am just rename one file?

script
Code:
rm 1
mv *.file 1
ls
mv *.file 1
mv *.file 1
mv *.file 1
mv *.file 1
mv *.file 1
exit


log
Code:
. 2017-04-21 01:31:40.278 Directory listing successful
. 2017-04-21 01:31:40.278 Got reply 1 to the command 2
< 2017-04-21 01:31:40.278 Script: Can't get attributes of file '1'.
< 2017-04-21 01:31:40.278 File or folder '1' does not exist.
. 2017-04-21 01:31:40.278 Script: Failed
. 2017-04-21 01:31:40.278 Session upkeep
. 2017-04-21 01:31:40.278 Script: Exit code: 1
. 2017-04-21 01:31:40.278 Script: Max roundtrip: 0
. 2017-04-21 01:31:40.278 Got reply 1004 to the command 2
. 2017-04-21 01:31:40.278 Disconnected from server
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25966
Location: Prague, Czechia
"full session log file", please!
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