If you want to download and delete the files only, use:get -delete "server/Work Files/*" "D:\Work Files\"
Brilliant that has worked 👍👍
Thanks so much for your help and patience.
Regards
Matt
If you want to download and delete the files only, use:get -delete "server/Work Files/*" "D:\Work Files\"
get -delete "server/Work Files/*" "D:\Work Files\"
Also, I'm usingsynchronize local
instead ofget
is that still not safe to do?
That probably explains the-delete
issue. Forsynchronize
the-delete
has very different meaning than forget
.
Useget
. You are not really "synchronizing" files.
Please read again:
https://winscp.net/eng/docs/faq_delete_synchronized_files
option batch abort
option confirm off
open sftp://username:password@serveraddress.com -hostkey="ssh-rsa 2048 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx username@serveraddress"
get -delete "server/Work Files" "D:\Work Files"
exit
Also, I'm usingsynchronize local
instead ofget
is that still not safe to do?
-delete
issue. For synchronize
the -delete
has very different meaning than for get
.
get
. You are not really "synchronizing" files.
I did try usingbut it didn't seem to work-delete
Can you post a log file for that?
so instead I have used the followingand it seems to work fine.rmdir "remote folder" mkdir "remote folder"
OK, but that's not transactionally safe (you can lose a file, if it is created betweenget
andrmdir
).
synchronize local
instead of get
is that still not safe to do?
I did try usingbut it didn't seem to work-delete
so instead I have used the followingand it seems to work fine.rmdir "remote folder" mkdir "remote folder"
get
and rmdir
).
Sorry for being vague about the notifications, I'm not good with scripting, it's a bit of a try this and hope it works situation. I was just thinking I could get a notification whether that's an email, prompt on my computer or something like that that can let me know all the files downloaded, similar to how Pushover works.
WinSCP does not do any notification on its own. All it does, is that it reports its result using its exit code. You can use the exit code to decide what notification to send using any 3rd party tool you like. As shown by the already linked example:
https://winscp.net/eng/docs/guide_automation#results
I'll be honest I will struggle to get this working with the documentation. I do have one script working from the YouTube video but that doesn't delete the files, is it possible to edit the script from the YouTube video to delete the files or does it need to be .NET?
It does not have to be .NET, you can probably do with simply adding the-delete
switch. Again, as shown in the article I've already linked:
https://winscp.net/eng/docs/faq_delete_synchronized_files#moving
-delete
rmdir "remote folder" mkdir "remote folder"
Sorry for being vague about the notifications, I'm not good with scripting, it's a bit of a try this and hope it works situation. I was just thinking I could get a notification whether that's an email, prompt on my computer or something like that that can let me know all the files downloaded, similar to how Pushover works.
I'll be honest I will struggle to get this working with the documentation. I do have one script working from the YouTube video but that doesn't delete the files, is it possible to edit the script from the YouTube video to delete the files or does it need to be .NET?
-delete
switch. Again, as shown in the article I've already linked:
Anyway, is there a way for me to automate downloading of files which when completed they get deleted from the server
I then receive some form of notification to let me know what files have been downloaded?