Move and Delete

for the source, use the sftp remote.

I ran the command (not sure if that is correct or not)

rclone move "ftpfileserver/hello.docx" "E:\Test\"

and the output was the following:

2022/02/07 16:50:42 ERROR : Local file system at //?/C:/Users/Matt/ftpfileserver/hello.docx: error reading source root directory: directory not found
2022/02/07 16:50:42 ERROR : Attempt 1/3 failed with 1 errors and: directory not found
2022/02/07 16:50:42 ERROR : Local file system at //?/C:/Users/Matt/ftpfileserver/hello.docx: error reading source root directory: directory not found
2022/02/07 16:50:42 ERROR : Attempt 2/3 failed with 1 errors and: directory not found
2022/02/07 16:50:42 ERROR : Local file system at //?/C:/Users/Matt/ftpfileserver/hello.docx: error reading source root directory: directory not found
2022/02/07 16:50:42 ERROR : Attempt 3/3 failed with 1 errors and: directory not found
2022/02/07 16:50:42 Failed to move: directory not found

the remote needs a colon character in it
ftpfileserver:/hello.docx

Oops, I changed that and I've now got this error.

2022/02/07 16:56:46 Failed to create file system for "ftpfileserver:/hello.docx": didn't find section in config file

That's my mistake, it should have been ftpserver and not ftpfileserver. Sorry.

I corrected it and looks like it's now working with the following command.

rclone move "ftpserver:test/hello.docx" "E:\Test\"

Thanks for your help. I'm going to test it more and see if it can do exactly what I need it to.

if you have a choice, make sure to use sftp, not ftp.

Yes, I have it setup as SFTP. I just named the remote as ftpserver as didn't know what else to call it.

I have done a few tests and it doesn't delete files on my local computer, do I need to add

--delete-after

cannot see into your computer,

run a command to move a single file, add -vv for debug log and post the debug log.
enclose the log with three backticks

Here's the output

2022/02/07 17:12:04 DEBUG : rclone: Version "v1.57.0" starting with parameters ["C:\\rclone\\rclone.exe" "move" "ftpserver:test/myfile.mp4" "E:\\Test\\" "-vv"]
2022/02/07 17:12:04 DEBUG : Creating backend with remote "ftpserver:test/myfile.mp4"
2022/02/07 17:12:04 DEBUG : Using config file from "C:\\Users\\Matt\\AppData\\Roaming\\rclone\\rclone.conf"
2022/02/07 17:12:05 DEBUG : sftp://matt3@iapetus.feralhosting.com:22/test/myfile.mp4: New connection 192.168.0.2:51716->185.21.216.160:22 to "SSH-2.0-OpenSSH_7.4p1 Debian-10+deb9u7"
2022/02/07 17:12:05 DEBUG : sftp://matt3@iapetus.feralhosting.com:22/test/myfile.mp4: Using absolute root directory "/media/sdh1/matt3/test/myfile.mp4"
2022/02/07 17:12:05 DEBUG : fs cache: adding new entry for parent of "ftpserver:test/myfile.mp4", "ftpserver:test"
2022/02/07 17:12:05 DEBUG : Creating backend with remote "E:\\Test\\"
2022/02/07 17:12:05 DEBUG : fs cache: renaming cache item "E:\\Test\\" to be canonical "//?/E:/Test/"
2022/02/07 17:12:05 DEBUG : myfile.mp4: Need to transfer - File not found at Destination
2022/02/07 17:12:05 DEBUG : sftp cmd = /media/sdh1/matt3/test/myfile.mp4
2022/02/07 17:12:05 DEBUG : sftp output = "d41d8cd98f00b204e9800998ecf8427e  /media/sdh1/matt3/test/myfile.mp4\n"
2022/02/07 17:12:05 DEBUG : sftp hash = "d41d8cd98f00b204e9800998ecf8427e"
2022/02/07 17:12:05 DEBUG : myfile.mp4: md5 = d41d8cd98f00b204e9800998ecf8427e OK
2022/02/07 17:12:05 INFO  : myfile.mp4: Copied (new)
2022/02/07 17:12:05 INFO  : myfile.mp4: Deleted
2022/02/07 17:12:05 INFO  :
Transferred:              0 B / 0 B, -, 0 B/s, ETA -
Checks:                 2 / 2, 100%
Deleted:                1 (files), 0 (dirs)
Renamed:                1
Transferred:            1 / 1, 100%
Elapsed time:         0.4s

2022/02/07 17:12:05 DEBUG : 12 go routines active

so that is not correct?

what is the output of
rclone ls ftpserver:test/myfile.mp4

It's correct to delete it on the server but I also want it to delete it if there's a file in the directory on my computer.

For example I have a folder on my computer called MyFolder and it already has MyFile.mp4 in it, the rclone command is run and it downloads MyFilm.mp4. I would like it to delete MyFile.mp4 (only delete the files in the location not the folder).

Is that possible?

sorry not understanding
sometimes you use directory, sometimes folder, sometimes location

perhaps use a detailed, real world, example, including remote and full paths.

Ok no problem.

In the following destination

/media/sdh1/matt3/test

is the following file.

FinalProject-Final.mp4

I run the following command

rclone move "ftpserver:test/" "E:\Test\"

This then moves the mp3 file onto my computer and deletes it from the server.

In E:\Test\ there's already FinalProject.mp4 on my computer, when the command runs, I would like it to delete the file that is already in that location on my computer.

Does that make sense? Sorry, I've always been bad at explaining things.

Thanks

if you want to delete E:\Test\FinalProject.mp4, then just delete it.

I would like it to be automatic so I don't have to do it as this won't be the only time.

well, how is rclone to magically know the name of the file you want to delete.
what is the rule rclone would use?

I just thought it might be able to delete anything within that folder that is older than the newest file being downloaded. I assumed these flags are what it means?

--delete-after                         When synchronizing, delete files on destination after transferring (default)
--delete-before                        When synchronizing, delete files on destination before transferring
--delete-during                        When synchronizing, delete files during transfer

well, those command as for rclone sync, not rclone move

write a two line script

delete all files in a folder
rclone move ...

Oh I wasn't aware it was only for sync as it didn't mention it on the page.

I'm not sure where to start with writing a script for deleting files in the folder. Would you know how to do it?

Thanks

"This option allows you to specify when files on your destination are deleted when you sync folders."