Need help with post processing - touch files - modified date
Need help with post processing - touch files - modified date
I have a files on two physical servers that are sync'd together (both synology servers). When I try to rename files on one, the other isn't updating with the name changes. I suspect because the modified date of the renamed files isn't changing. I tried changing the "creation date" and timestamp using post processing but still no change. My thought was to try to change the modified date of the files in question, but it looks like there isn't a preset for that in the post-processing dialog. So I'm looking at having to create a custom script. Can someone please help with some guidance on how to accomplish this? I looked at the example scripts, but am at a bit of a loss on how to implement what I need. Thanks in advance for your help!
Re: Need help with post processing - touch files - modified date


Shell: Select all
--apply touch

Shell: Select all
-exec touch {f} +
Re: Need help with post processing - touch files - modified date
Thanks for the quick response. I'm using drive sync utility for Synology. I'm not sure how it handles renaming files. Additional note: I am renaming the files in-place using the following custom preset: {drive}/{plex.name} So I'm not sure if that has any impact on file changes. However, if I manually rename a file without moving it to a new location (in-place) the sync updates properly.
When I put -exec touch {f} + in the script editor I get an error: "Syntax Error: Unexpected input 'touch {f} +
When I put --apply touch I get the following: "MissingProperty: no such property: apply for class: Script"
When I put -exec touch {f} + in the script editor I get an error: "Syntax Error: Unexpected input 'touch {f} +
When I put --apply touch I get the following: "MissingProperty: no such property: apply for class: Script"
Re: Need help with post processing - touch files - modified date





Re: Need help with post processing - touch files - modified date
For Synology I'm on DSM 7.2.2. The sync utility in question is a built-in Synology utility called "Synology Drive ShareSync".
I had previously installed the 3rd party version of filebot (jlesage/filebot) and found that {drive}/{plex.name} and {plex.name} do the same thing (copy in place). To be sure it wasn't something specific to that version of filebot I went ahead and installed your version.
When I try either {drive}/{plex.name} or just {plex.name} I get a permission denied error and can't rename the files. The error shows the same location for both versions of the expression.
See screenshot:

I had previously installed the 3rd party version of filebot (jlesage/filebot) and found that {drive}/{plex.name} and {plex.name} do the same thing (copy in place). To be sure it wasn't something specific to that version of filebot I went ahead and installed your version.
When I try either {drive}/{plex.name} or just {plex.name} I get a permission denied error and can't rename the files. The error shows the same location for both versions of the expression.
See screenshot:
Re: Need help with post processing - touch files - modified date
I checked the permissions on the folder above the files and it seems like "write" for group and other was unchecked. I checked all the permissions and was able to get the rename to work. However, even if I tick "timestamp" for post processing it looks like the modified date of the files does not update.
Re: Need help with post processing - touch files - modified date
Here is a screenshot of my source server that renamed the files. As you can see by the modified date still has an old date on them:

Last edited by begunfx on 11 Jan 2025, 22:18, edited 1 time in total.
Re: Need help with post processing - touch files - modified date
Incidentally I tried using {drive}/{plex.name} and {plex.name} as rename expressions and they both seem to do the same thing renaming the files in place (for your version of filebot). {drive}/{plex.name} does not seem to move the files to the root of the drive as you mentioned in your previous post.
Re: Need help with post processing - touch files - modified date



Groovy: Select all
{ source, target ->
system 'touch', target
}
Re: Need help with post processing - touch files - modified date
Okay. Thanks for clarity on the {drive} and {folder} options. Noted. As for the modification of files, I ssh'd into my primary server and ran a touch command on the test file. It didn't look like the slave server's file timestamp updated. If I run the touch command you provided above as a post process it does update the source test files timestamp, but also doesn't not trigger a change in the destination files. There must be another way that then that Synology Drive ShareSync detects changes in the file. I would have assume doing the rename would have been enough. Any ideas?
Re: Need help with post processing - touch files - modified date
After some research, it seems like there is an issue with Docker not triggering 'inotify' events on synology which is what it's drive sync uses to update files. Somehow, I need a way to trigger an 'inotify' event or force a manual index to update the files. Any suggestions? I'm stumped. All the workarounds I found didn't look very appealing.
The only thing I could possibly think of is create a script that runs a touch on files using an argument and have that script live on my host outside of docker and then somehow have filebot call that script and pass the path/filename(s) to it. It seems like filebot is capable of triggering an external script. Any guidance on how to do this? Thanks!
Edit: To test, I renamed files on my source host via filebot, but ran a touch command via ssh directly on the host on one of the files. Sure enough, the destination host updated the name to match. The only problem I found was if I revert the source files back, if I do the same thing with touch it just thinks a new file was added. So really it would have to be some sort of triggering with a re-index is my guess but I can't seem to find anyway on a synology server to execute a re-index via command prompt the drive syncShare utility.
So in essence at the moment the workaround is to trigger a touch in an external script and not use the "revert" functionality (which would suck).
The only thing I could possibly think of is create a script that runs a touch on files using an argument and have that script live on my host outside of docker and then somehow have filebot call that script and pass the path/filename(s) to it. It seems like filebot is capable of triggering an external script. Any guidance on how to do this? Thanks!
Edit: To test, I renamed files on my source host via filebot, but ran a touch command via ssh directly on the host on one of the files. Sure enough, the destination host updated the name to match. The only problem I found was if I revert the source files back, if I do the same thing with touch it just thinks a new file was added. So really it would have to be some sort of triggering with a re-index is my guess but I can't seem to find anyway on a synology server to execute a re-index via command prompt the drive syncShare utility.
So in essence at the moment the workaround is to trigger a touch in an external script and not use the "revert" functionality (which would suck).
Re: Need help with post processing - touch files - modified date
Why use docker at all? Looks like it's not suitable for your use case.
You can just rename files via a network drive from your Desktop. If a SMB share does not work for some reason then you can always use SFTP or SSHFS since you already have that.
If you must use your docker container WebUI then you can at least still use normal Synology non-docker filebot on a schedule to auto-generate the secondary structure.
You can just rename files via a network drive from your Desktop. If a SMB share does not work for some reason then you can always use SFTP or SSHFS since you already have that.
If you must use your docker container WebUI then you can at least still use normal Synology non-docker filebot on a schedule to auto-generate the secondary structure.
Re: Need help with post processing - touch files - modified date
Thanks, rednoah. I hadn't thought about using the desktop version. I went ahead and downloaded the mac version and it worked as expected. I guess going with the desktop version the only thing I lose is the ability to use it remotely, but it's not the end of the world. As it is, I will most likely do the renaming locally anyway.
Re: Need help with post processing - touch files - modified date
You may also consider setting up some automation with the CLI. We have FileBot packages for Synology. Installation is easy. Usage naturally not as easy as the Desktop app. But that way you could set up some automation and process files on device without the problematic docker overlay file system layer. Some prefer the CLI over the GUI because it's easy to use via SSH remotely.
EDIT:
An issue that you will find with the macOS SMB implementation is that hard links don't work. Oddly enough, modern Windows implements the SMB unix extensions while macOS does not. So to auto-generate your secondary structure with hard links, you will likely have to do so on device, or use a Windows Desktop.
EDIT:
An issue that you will find with the macOS SMB implementation is that hard links don't work. Oddly enough, modern Windows implements the SMB unix extensions while macOS does not. So to auto-generate your secondary structure with hard links, you will likely have to do so on device, or use a Windows Desktop.