Davno
02-13-2009, 10:04 AM
Hi,
I have a nfs server and 3 client pc. I made a script that backup and synchronize the nfs share directory on the clients. The files are being deleted (on purpose) on the client pc if these files are no more on the nfs server share directory. The nfs share is being automounted at boot time on the clients machine (if the server is up naturally). I want to make a cron job so that the sync script will run once or twice a day. Up to now i have no problem, the problem is that the server is not always on and if the script is being run when the server is off the nfs share will not be mounted on the client and i am afraid that all those files will be deleted from the client directory when the sync script see an empty mount point.
I need a line to add at the begining of the client script that will check if the nfs server is up and if it is mounted on the client share directory before the script is being run by cron or manually.
PS: the script is run on each of the clients pc.
At first i though it would make more sense if the script was being run by the server instead (looking for live clients) but i could not figure how to do it. :o
I have a nfs server and 3 client pc. I made a script that backup and synchronize the nfs share directory on the clients. The files are being deleted (on purpose) on the client pc if these files are no more on the nfs server share directory. The nfs share is being automounted at boot time on the clients machine (if the server is up naturally). I want to make a cron job so that the sync script will run once or twice a day. Up to now i have no problem, the problem is that the server is not always on and if the script is being run when the server is off the nfs share will not be mounted on the client and i am afraid that all those files will be deleted from the client directory when the sync script see an empty mount point.
I need a line to add at the begining of the client script that will check if the nfs server is up and if it is mounted on the client share directory before the script is being run by cron or manually.
PS: the script is run on each of the clients pc.
At first i though it would make more sense if the script was being run by the server instead (looking for live clients) but i could not figure how to do it. :o