This is a pre-use question so I'm not having any problems thus far. I am wondering if it is possible to download a file from FTP to my local computer and if there's already a file in that folder on my local computer delete the excisting file(s) as well as delete the file on the server. For example, on my local computer I have example.docx and on the FTP there's example-john-edit.docx, I want rclone to be able to download example-john-edit.docx to my local computer and delete example.docx from my local computer as well delete example-john-edit.docx on the server.
Is that possible? I've seen there's a move command but didn't see anything as specific as my needs.
Run the command 'rclone version' and share the full output of the command.
N/A
Which cloud storage system are you using? (eg Google Drive)
FTP on a server
The command you were trying to run (eg rclone copy /tmp remote:tmp)
If you move from source to destination, it'll delete from the source and copy to the destination.
You can decide how you want to overwrite the destination. Generally, if the destination is different, it'll overwrite it. There are many parameters to tweak that behavior.
Easy enough to setup and test. Give it a try and see if it does what you want and if not, share what you did and what you want to happen and we can surely figure it out.
If I have it setup like the following... G:\Files\Documents\John\2022\ will it delete everything within the files folder or do I need to set something for it to not?
I'm new to all this so I need to research how to setup rclone as it's all command line and I've only used this sort of stuff with help/guides.
I will see if I can set it up and test and see how I get on.
I have tried setting up rclone but not sure if I have done it correctly as I can't get anything to work.
Do I have to install rclone on my server rather than my local computer to get it to transfer files to my local computer as I am getting the following error...
2022/02/07 15:19:11 ERROR : Local file system at //?/C:/media/sdh1/matt3/test/hello.docx: error reading source root directory: directory not found
That directory doesn't exist on my local computer as that's the directory on the server.
I have rclone installed on my computer and I'm trying to transfer files from the server to my computer.
Here's the output from the command.
2022/02/07 15:49:34 DEBUG : rclone: Version "v1.57.0" starting with parameters ["C:\\rclone\\rclone.exe" "move" "/media/sdh1/matt3/test/hello.docx" "E:\\" "-vv"]
2022/02/07 15:49:34 DEBUG : Creating backend with remote "/media/sdh1/matt3/test/hello.docx"
2022/02/07 15:49:34 DEBUG : Using config file from "C:\\Users\\Matt\\AppData\\Roaming\\rclone\\rclone.conf"
2022/02/07 15:49:34 DEBUG : fs cache: renaming cache item "/media/sdh1/matt3/test/hello.docx" to be canonical "//?/C:/media/sdh1/matt3/test/hello.docx"
2022/02/07 15:49:34 DEBUG : Creating backend with remote "E:\\"
2022/02/07 15:49:34 DEBUG : fs cache: renaming cache item "E:\\" to be canonical "//?/E:/"
2022/02/07 15:49:34 DEBUG : Local file system at //?/E:/: Using server-side directory move
2022/02/07 15:49:34 INFO : Local file system at //?/E:/: Server side directory move failed - fallback to file moves: can't copy directory - destination already exists
2022/02/07 15:49:34 ERROR : Local file system at //?/C:/media/sdh1/matt3/test/hello.docx: error reading source root directory: directory not found
2022/02/07 15:49:34 DEBUG : Local file system at //?/E:/: Waiting for checks to finish
2022/02/07 15:49:34 DEBUG : Local file system at //?/E:/: Waiting for transfers to finish
2022/02/07 15:49:34 ERROR : Attempt 1/3 failed with 1 errors and: directory not found
2022/02/07 15:49:34 DEBUG : Local file system at //?/E:/: Using server-side directory move
2022/02/07 15:49:34 INFO : Local file system at //?/E:/: Server side directory move failed - fallback to file moves: can't copy directory - destination already exists
2022/02/07 15:49:34 ERROR : Local file system at //?/C:/media/sdh1/matt3/test/hello.docx: error reading source root directory: directory not found
2022/02/07 15:49:34 DEBUG : Local file system at //?/E:/: Waiting for checks to finish
2022/02/07 15:49:34 DEBUG : Local file system at //?/E:/: Waiting for transfers to finish
2022/02/07 15:49:34 ERROR : Attempt 2/3 failed with 1 errors and: directory not found
2022/02/07 15:49:34 DEBUG : Local file system at //?/E:/: Using server-side directory move
2022/02/07 15:49:34 INFO : Local file system at //?/E:/: Server side directory move failed - fallback to file moves: can't copy directory - destination already exists
2022/02/07 15:49:34 ERROR : Local file system at //?/C:/media/sdh1/matt3/test/hello.docx: error reading source root directory: directory not found
2022/02/07 15:49:34 DEBUG : Local file system at //?/E:/: Waiting for checks to finish
2022/02/07 15:49:34 DEBUG : Local file system at //?/E:/: Waiting for transfers to finish
2022/02/07 15:49:34 ERROR : Attempt 3/3 failed with 1 errors and: directory not found
2022/02/07 15:49:34 INFO :
Transferred: 0 B / 0 B, -, 0 B/s, ETA -
Errors: 1 (retrying may help)
Elapsed time: 0.0s
2022/02/07 15:49:34 DEBUG : 2 go routines active
2022/02/07 15:49:34 Failed to move: directory not found
I have installed rclone on my Windows computer so I can automatically download new files from a linux server to my computer.
I'm currently using a script with WinSCP which does work well but it doesn't delete any files that are already in the local directory.
If it helps, this is the current script I am using
option batch abort
option confirm off
open sftp://[username/password/host] -hostkey="[keyhere]"
get -delete "/media/sdh1/matt3/Files/*" "E:\Files"
exit
In short, I want to be able to download files from the server to my computer and have the file deleted from the server as well as delete any local files if there's already one in that folder, if not don't delete.
2022/02/07 16:43:52 ERROR : Local file system at //?/C:/media/sdh1/matt3/test/hello.docx: error reading source root directory: directory not found
2022/02/07 16:43:52 ERROR : Attempt 1/3 failed with 1 errors and: directory not found
2022/02/07 16:43:52 ERROR : Local file system at //?/C:/media/sdh1/matt3/test/hello.docx: error reading source root directory: directory not found
2022/02/07 16:43:52 ERROR : Attempt 2/3 failed with 1 errors and: directory not found
2022/02/07 16:43:52 ERROR : Local file system at //?/C:/media/sdh1/matt3/test/hello.docx: error reading source root directory: directory not found
2022/02/07 16:43:52 ERROR : Attempt 3/3 failed with 1 errors and: directory not found
2022/02/07 16:43:52 Failed to move: directory not found