Move Filses after sync

Get help for specific problems
Posts: 2
Joined: 25 Jan 2024

maniacdeveloper

Hello,
I transfer pdf-files from my local drive to a folder on my webspace. There runs a process that, after being finished, moves the files to a subfolder. So every time FFS runs, it thinks the local files are missing on the remote drive and transfer then again.

So can I move the sunced files locally to a subfolder after being transferred to the remotefolder?
User avatar
Posts: 3616
Joined: 11 Jun 2019

xCSxXenon

You can define a post-sync command that runs after FFS finishes a sync. Use this area to run a command or script that moves the files
Posts: 2
Joined: 25 Jan 2024

maniacdeveloper

So no build in function but the possibility to run a batch, right?

BUT: What if, while syncing, new files arrive in the source folder, that would be moved by the batch, that does not know, which files have been synced.
User avatar
Posts: 3616
Joined: 11 Jun 2019

xCSxXenon

That is an edge case that you would have to account for, yes.
I would resolve that by creating a batch script that creates a 'processing' folder, moves all files currently in the source folder to that subfolder, calls the FFS sync job, then deletes that 'processing' folder once everything completes. You will want some error checking in there to check the exit code that FFS returns in case not all files get moved over
User avatar
Site Admin
Posts: 7056
Joined: 9 Dec 2007

Zenju

Sounds like this case can be solved via the "Update" variant.
User avatar
Posts: 3616
Joined: 11 Jun 2019

xCSxXenon

Sounds like this case can be solved via the "Update" variant. Zenju, 26 Jan 2024, 09:49
I don't think so. If new files are created in the source during a sync, they won't get transferred to the destination, then the post-sync command will delete everything in the source, thus removing the new files that weren't yet copied to the destination.
Posts: 945
Joined: 8 May 2006

therube

If after a sync has been run, you parse the .log file, & for every "Verifying file" entry in the log, if you then moved all those associated source files out of the source directory, then the only files left in source would be new files that ended up in there during or after the last sync process.

That done, you can at that point, or whenever, run another (Update) sync, to do it all over again.

(I don't know what a failed 'Verifying file' entry might look like, so you might want to take that into consideration.)
User avatar
Site Admin
Posts: 7056
Joined: 9 Dec 2007

Zenju

Sounds like this case can be solved via the "Update" variant. Zenju, 26 Jan 2024, 09:49
I don't think so. If new files are created in the source during a sync, they won't get transferred to the destination, then the post-sync command will delete everything in the source, thus removing the new files that weren't yet copied to the destination. xCSxXenon, 26 Jan 2024, 16:43
No, I meant instead of the "post sync script". If the move operation happens on the server, and OP wants it to also happen locally, then maybe "Two Way" does the job.