Re: *FIXED* 301 Moved Permently
Add a slash to the target path:
mv test.txt /home/eg/archiv/
mv test.txt /home/eg/archiv/
/home/eg/data
to remote /home/eg/archiv
. It says Error at moving File 'test.txt' to '/home/eg/archiv'
301 Moved Permanently
@echo off
"U:\03_IT\0300_Administration\03_Portable\WinSCP\WinSCP.com" ^
/log="U:\03_IT\0300_Administration\03_Portable\WinSCP\log\WINSCPLog.txt" /ini=nul ^
/command ^
"option batch abort"^
"option confirm off"^
"open davs://username:password@connection.de/home/eg/data -certificate=""xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx""" ^
"lcd ::UNC Path:: \\test\testing\example"^
"get test.tab" ^
"mv test.txt /home/eg/archiv"^ # remote directory
"exit"
PAUSE
/
at the mv
parameter
"mv test.txt /home/eg/archiv/"^
Archive
folder from get
command using -filemask=|Archive/
.
mv
. And even if it was, it won't be transactionally safe. What if a file is added just between get
and mv
?
*.?*
instead of *.*
. That will match only files (and folders) which have some extension (so not Archive
).
mv
command and that does what I need it to
# ftpfromXYZ.txt
option batch on
option confirm off
open sftp://username:Password@partner.site.com:22
get -resume *.txt "\\Local-srv\Secure$\Downloads\XYZ\"
get -resume *.xlsx "\\Local-srv\Secure$\Downloads\XYZ\"
mv *.txt Archive/
mv *.xlsx Archive/
close
exit
*.csv
in the root; how would I download ALL files EXCEPT the Archive
directory, and move all files regardless of format to the Archive
directory when done? How would I make sure I successfully copied the file first? I'm new to this, sorry!
.txt
and .xlsx
files to a root directory; when we have finished grabbing the files they have dumped, we move them to an Archive
directory under root.
Archive
folder to show them we have retrieved these.
# ftpfromXYZ.txt
option batch on
option confirm off
open sftp://username:Password@partner.site.com:22
get -resume *.txt "\\Local-srv\Secure$\Downloads\XYZ\"
get -resume *.xlsx "\\Local-srv\Secure$\Downloads\XYZ\"
close
exit