making Rsnapshot backup to mount NFS-Share

  • Hello,


    I am using OMV 3.x it is working fine.
    I use rsnapshot for backup to a NFS-mounted directory. But when the remote NFS-server is not running, rsnapshot make the backup to the unmount base-directory. How can I "tell" rsnapshot, only backup files, when there exists the NFS-mount?


    Regards
    Franz

    • Offizieller Beitrag

    How can I "tell" rsnapshot, only backup files, when there exists the NFS-mount?


    There is linux/unix utility called autofs, it mounts the requested remote directory on access, after a while it times out and disconnects the share removing the folder also if there is no process accessing it. I can't find options in the rsnapshot man something like check if target directory exists first, but you can give it a try, maybe rsnapshot does it already checks if path exists first. I would check this before proceeding to configure autofs which is not easy to understand at the beginning


    Here you can find a guide for ubuntu


    https://help.ubuntu.com/community/Autofs

  • @subzero79


    thanks for your answer. Autofs was my first inspiration too, but I did not realized that AutoFS removes the base directory when the mount is not used. I think this a solution ...
    I know how to use AutoFs. It it so easy to use.
    I will try it later ( backups are running now ...)
    Thanks for the hint


    a few minutes later ...
    It is not working;-)
    Rsnapshot creates the missing base directory ...


    Franz

  • I think for a "quick & dirty" processing, I will modify the rsnapshot script ...
    Then I will think about a better way.


    But not today ... friends are coming...


    I will report here!


    Have a nice day
    Franz

  • I remove the nfs mount statement from fstab.
    I installed autofs.

    Code: /etc/auto.master
    /media/bcffb16c-a3a2-40a0-995c-c98781c15ed3/synology /etc/auto.synology --timeout=5 --ghost



    Code: /etc/auto.synology
    NFS -fstype=nfs,rw 10.1.10.13:/volume2/OMV


    when autofs mounts my nfs-share, the directory /media/.../synology/NFS exists otherwise not.



    I create a new variable "BackupDir" and test it in the line, where rsnapshot decides which rsnapshot-task should start (3rd if-statement). I make short output on the console-terminal, if the directory is not found.
    If I change the rsnapshot settings with the WebGui, I must to redo it. I have to search die building-commands from the WebGui.
    But for now it is working for me.


    Franz

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!