Need to move the file instead of deleting it

Advertisement

MarcM
Joined:
Posts:
5
Location:
Canada

Need to move the file instead of deleting it

Good day All,

I'm new with WinSCP and I manage to do this line when calling the program by my Task Manager.
But I need to move the file to another folder instead of deleting it could anyone help me please.

this is what I have :
/log="C:\"location of the LoG"\WinSCP.log" /ini=nul /command "open ftps://"Information of the Connection -certificate=""information of the certificate""" "cd /ftpRemoteFolder" "lcd C:\"location where I want to file to be"\Inbound" "get -delete *" "exit"
I'm trying to include a MV instead of the -delete but it's not in the working at all

thanks for your help

Marc

Reply with quote

Advertisement

MarcM
Joined:
Posts:
5
Location:
Canada

Need to move the file instead of deleting it

Since this script is in production I need to be sure of my change if I do this do you think it would work
I have added the mv.... and removed the -delete
/log="C:\"location of the LoG"\WinSCP.log" /ini=nul /command "open ftps://"Information of the Connection -certificate=""information of the certificate""" "cd /ftpRemoteFolder" "lcd C:\"location where I want to file to be"\Inbound" "get *" "mv * /archive/*" "exit"

the archive folder is at the same level of the ftpRemoveFolder.

thanks for your help

Marc

Reply with quote

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

Re: Need to move the file instead of deleting it

Yes, it looks good. Of course, you must be sure that no new file is created between get and mv.

Reply with quote

MarcM
Joined:
Posts:
5
Location:
Canada

Re: Need to move the file instead of deleting it

Hi Martin,

Thanks for your reply. How can I do that verify to make sure there's no new files?

Thanks for your help really appreciate.

Marc

Reply with quote

MarcM
Joined:
Posts:
5
Location:
Canada

Need to move the file instead of deleting it

Hi again,

do you think it would be possible to do 1 mv before to a temps folder, then do the get * on that temps folder and then mv to the archive folder? Like this maybe, do you think it would work?

/log="C:\"location of the LoG"\WinSCP.log" /ini=nul /command "open ftps://"Information of the Connection -certificate=""information of the certificate""" "cd /ftpRemoteFolder" "lcd C:\"location where I want to file to be"\Inbound" "mv * /tempFolder/*" "get /tempFolder/*" "mv /tempFolder/* /archive/*" "exit"

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum