Idea for RTS via SFTP

Get help for specific problems
Posts: 21
Joined: 2 Aug 2016

CaptainStarbuck

I've come back to an issue that I had forgotten about, the inability to do RTS with a remote server via SFTP. I understand that we can't monitor through SFTP. But what if we have a common script that gets run on the remote server via cron, one that does something like "ls -la > /path/rts.data". The first thing RTS will do is to retrieve that file. It can then parse the file to retrieve the same data that would be obtained by monitoring. With the ls command that means the last update time, but if the command(s) is more detailed then we can also get a hash of the remote file. So FFS just needs to check this remote rts.data file against the current file system when a local update occurs. The actual script can generate desired data and in a desired format specifically for FFS. The file doesn't need to be stored in a target folder, it can be stored in any pre-defined folder.

To keep it simpler, for one specific use case I just need to move files from local to remote. I do not need to monitor the remote system for changes or for the existence of files before replacement. It would be very helpful if RTS didn't "monitor" the remote system via SFTP, just force all local files on every update. Until a better solution is available, I can manage what gets stored locally in a monitored folder to minimize transfer time.

Another somewhat less desirable option would be to use the same credentials from SFTP to SSH into the FTP server to execute a script like the above. This eliminates the need for a remote cron to run. Login, execute the script to provide the rts.data, then retrieve it immediately or come back in via SFTP to retrieve it. That becomes the monitoring process. No, it's not cool to have an app on a PC login into a secure server and run "random" scripts. but we're already trusting FFS to access our servers and manipulate our files. I don't see this as any more of a security risk. YMMV

Given the choice of having no SFTP access, and less-than-ideal options, I'd go for the latter.

Thoughts?
Thanks.
User avatar
Site Admin
Posts: 7210
Joined: 9 Dec 2007

Zenju

Since the SFTP and FTP protocols do not offer a means to get change notifications instantly, every workaround pretty much comes down to polling. And this is doable already by scheduling a FreeFileSync batch job to run every x minutes, e.g. via task scheduler.

The most common scenario however is to monitor only the local source side for changes. This can be implemented by simply removing the SFTP folder in RealTimeSync. RTS just triggers FreeFileSync, so there is no reason why RTS must monitor the exact same folders that the FreeFileSync batch job is syncing.
Posts: 21
Joined: 2 Aug 2016

CaptainStarbuck

It took me a while to get back to this and to understand your two points.
Indeed both method are effective and I'm now using RTS without checking the SFTP folder.
Thank you VERY much.