Check if NFS mount is mounted before running job

English Support for Syncovery on Linux etc.
Post Reply
IMTheNachoMan
Posts: 140
Joined: Sun Nov 20, 2022 5:11 am

Check if NFS mount is mounted before running job

Post by IMTheNachoMan »

I have an NFS mount on my Linux server. Sometimes the NFS server is unavailable and is not mounted.

How can I tell Syncovery to first check if the NFS mount is mounted before running the job? If it is not mounted, then don't run the job.
tobias
Posts: 1933
Joined: Tue Mar 31, 2020 7:37 pm

Re: Check if NFS mount is mounted before running job

Post by tobias »

Hello,
the easiest solution is the checkmark
"Run Only If Neither Side Is Empty"

on the "Job" tab sheet in the profile.
IMTheNachoMan
Posts: 140
Joined: Sun Nov 20, 2022 5:11 am

Re: Check if NFS mount is mounted before running job

Post by IMTheNachoMan »

Oh. Brilliant.

That will work most of the time I think.

Sometimes when the NFS server is down, and my computer is rebooted, it can't mount the NFS mount but the folder is still there on the root disk. And so sometimes files end up writing to it.

But this should work good enough for me.

Or maybe, is there a pascal script I could run that checks for the existing of a specific file and if that file is not there then it doesn't run the job?
tobias
Posts: 1933
Joined: Tue Mar 31, 2020 7:37 pm

Re: Check if NFS mount is mounted before running job

Post by tobias »

Hello,
yes, you can use this script:

Code: Select all

function OnProfileStart:Boolean;
begin
  Result:=FileExists('/mnt/volxyz/signalfile.txt');
  end;
IMTheNachoMan
Posts: 140
Joined: Sun Nov 20, 2022 5:11 am

Re: Check if NFS mount is mounted before running job

Post by IMTheNachoMan »

Love it. Thank you!
Post Reply