Move all files between the same sftp server
Hi!
I need to copy files from a sftp server to our server, and then, move the files in the original dir to a subdir.
open sftp://user:password@server
cd /incoming/out
option exclude "processed/"
lcd \\server\sftp\IN\
mget *
close
Thats the part that works ok. But i dont know how to make the second step.
Maybe creating a mask? Something like this
cd
cd /incoming/out
put -filemask="|*/" *.gpg
mv *.gpg /incoming/out/processed/
give me the log message:
* 2017-05-15 15:10:00.919 (ETerminal) Permission denied.
* 2017-05-15 15:10:00.919 Error code: 3
* 2017-05-15 15:10:00.919 Error message from server: Permission denied
. 2017-05-15 15:10:00.919 Asking user:
. 2017-05-15 15:10:00.919 Cannot overwrite remote file '/incoming/out/file'.$$
. 2017-05-15 15:10:00.919
. 2017-05-15 15:10:00.919 Press 'Delete' to delete the file and create new one instead of overwriting it.$$ ("Permission denied.
. 2017-05-15 15:10:00.919 Error code: 3
. 2017-05-15 15:10:00.919 Error message from server: Permission denied")
< 2017-05-15 15:10:00.919 Script: Cannot overwrite remote file '/incoming/out/file'.
< 2017-05-15 15:10:00.935 Script: Permission denied.
< 2017-05-15 15:10:00.935 Error code: 3
< 2017-05-15 15:10:00.935 Error message from server: Permission denied
* 2017-05-15 15:10:00.935 (EScpSkipFile) Cannot overwrite remote file '/incoming/out/file'.$$
* 2017-05-15 15:10:00.935
* 2017-05-15 15:10:00.935 Press 'Delete' to delete the file and create new one instead of overwriting it.$$
* 2017-05-15 15:10:00.935 Permission denied.
* 2017-05-15 15:10:00.935 Error code: 3
* 2017-05-15 15:10:00.935 Error message from server: Permission denied
. 2017-05-15 15:10:00.935 Script: Failed
. 2017-05-15 15:10:00.935 Script: Exit code: 1
. 2017-05-15 15:10:00.935 Closing connection.
. 2017-05-15 15:10:00.935 Sending special code: 12
. 2017-05-15 15:10:00.935 Sent EOF message
Can you help me?
Regards!
I need to copy files from a sftp server to our server, and then, move the files in the original dir to a subdir.
open sftp://user:password@server
cd /incoming/out
option exclude "processed/"
lcd \\server\sftp\IN\
mget *
close
Thats the part that works ok. But i dont know how to make the second step.
Maybe creating a mask? Something like this
cd
cd /incoming/out
put -filemask="|*/" *.gpg
mv *.gpg /incoming/out/processed/
give me the log message:
* 2017-05-15 15:10:00.919 (ETerminal) Permission denied.
* 2017-05-15 15:10:00.919 Error code: 3
* 2017-05-15 15:10:00.919 Error message from server: Permission denied
. 2017-05-15 15:10:00.919 Asking user:
. 2017-05-15 15:10:00.919 Cannot overwrite remote file '/incoming/out/file'.$$
. 2017-05-15 15:10:00.919
. 2017-05-15 15:10:00.919 Press 'Delete' to delete the file and create new one instead of overwriting it.$$ ("Permission denied.
. 2017-05-15 15:10:00.919 Error code: 3
. 2017-05-15 15:10:00.919 Error message from server: Permission denied")
< 2017-05-15 15:10:00.919 Script: Cannot overwrite remote file '/incoming/out/file'.
< 2017-05-15 15:10:00.935 Script: Permission denied.
< 2017-05-15 15:10:00.935 Error code: 3
< 2017-05-15 15:10:00.935 Error message from server: Permission denied
* 2017-05-15 15:10:00.935 (EScpSkipFile) Cannot overwrite remote file '/incoming/out/file'.$$
* 2017-05-15 15:10:00.935
* 2017-05-15 15:10:00.935 Press 'Delete' to delete the file and create new one instead of overwriting it.$$
* 2017-05-15 15:10:00.935 Permission denied.
* 2017-05-15 15:10:00.935 Error code: 3
* 2017-05-15 15:10:00.935 Error message from server: Permission denied
. 2017-05-15 15:10:00.935 Script: Failed
. 2017-05-15 15:10:00.935 Script: Exit code: 1
. 2017-05-15 15:10:00.935 Closing connection.
. 2017-05-15 15:10:00.935 Sending special code: 12
. 2017-05-15 15:10:00.935 Sent EOF message
Can you help me?
Regards!