openmediavault-onedrive: Is it using the "inotify" FS monitoring?

  • Hi everyone,


    while troubleshooting a performance issue, I noticed that my source drive for a onedrive-mirror is pegged at 100% util in `iostat` whenever onedrive performs a filesystem scan. I was wondering: Is the scan really necessary, especially at the default rate of every 5 minutes?


    Reading the github README of https://github.com/abraunegg/onedrive/, it seems like abraunegg has implemented a light-weight monitoring of the filesystem (which would not necessarily require periodic rescans?) via `inotify`. Is the implementation via plugin also using this API? https://www.man7.org/linux/man-pages/man7/inotify.7.html


    For now I've reduced my synch to every 60 minutes, because it really is just a mirror for convenience and backup, but it would be nice if local changes were synched in real-time.

  • chente

    Hat das Thema freigeschaltet.
  • chente

    Hat das Thema freigeschaltet.
    • Offizieller Beitrag

    Is the implementation via plugin also using this API? https://www.man7.org/linux/man-pages/man7/inotify.7.html

    The openmediavault-onedrive plugin installs the onedrive client and configures it, nothing more. So i can not say anything about how onedrive monitors the file changes. But i assume it is using inofity, because this is interface that should be used in such case.

  • I see, thanks! I just tested it quickly and it is indeed the case that changes are detected instantly (for example when I edited a text-file). Really cool :)

    Perhaps it is still worth considering to lower the default synch frequency?

  • Hi all,


    I just joined the forum due to a problem I am facing concerning the omv-onedrive plugin and inotify. Therefore, i think the post fits here.


    I backed up my omv data to a secound locally mounted harddrive using borgbackup. Since I also want to have an external backup, I decided to use the omv-onedrive plugin for uploading my backup directories to the cloud. I use the "upload-only" and the "no-remote-delete" option because I dont want the cloud backup to be deleted if the local one is and the same with the local one. And, I also use an "monitor-intervall" of 24 h, because I want to sync my backup once a day.


    But, because of "inotify" real-time changes in the files are tracked and uploaded immediately ignoring the configured "monitor-intervall". I learned this from the onedrive-linux-client documentation (onedrive/docs/USAGE.md at master · abraunegg/onedrive · GitHub).


    I dont want to upload changes immediately, but only everey 24h. Do you have an idea how I can achieve this behavior?


    Thank you very much.


    Best regards,

    Gregor


    • Offizieller Beitrag

    But, because of "inotify" real-time changes in the files are tracked and uploaded immediately ignoring the configured "monitor-intervall". I learned this from the onedrive-linux-client documentation (onedrive/docs/USAGE.md at master · abraunegg/onedrive · GitHub).


    I dont want to upload changes immediately, but only everey 24h. Do you have an idea how I can achieve this behavior?

    abraunegg Is it somehow possible to disable the inotify realtime monitoring?

  • votdev

    Hat das Label OMV 6.x hinzugefügt.
  • Is it somehow possible to disable the inotify realtime monitoring?

    Yes there is - do not use --monitor for client operations.


    I dont want to upload changes immediately, but only everey 24h. Do you have an idea how I can achieve this behavior?

    The only way to achieve this is to not use a systemd service (which uses --monitor .. thus inotify) and configure your system to run a cronjob at the specified interval that calls 'onedrive' using the following options: --synchronize --upload-only --no-remote-delete


    This will upload your files as per requirement on your required schedule, ignoring any real-time changes that might occur in the meantime or during the collation of your backup items.


    Now you could also expand this and have this 'backup job' as a secondary configuration (use the --confdir option), so you can have (if required) other data going to OneDrive in real-time and the backups only going on your schedule. In this scenario you have more flexibility to specify inclusion|exclusion and potentially even for the backups use --single-directory so that only the backup folder is being targeted.


    If you are not fazed by jumping into a CLI to do things, I would do that and ignore using the current OMV interface for client configuration and operation, otherwise there will need to be development in the OMV interface to surface all client options and capabilities + even surface creating a cronjob that runs 'onedrive' for you to achieve your desired outcome.

    • Offizieller Beitrag

    Thx for the explanation.


    Gregor_OMV If you want to continue without inotify you need to configure OneDrive on your own because the OMV is using systemd.

    You can use the scheduled jobs to configure a crib job via UI.

  • votdev

    Hat das Label gelöst hinzugefügt.

Jetzt mitmachen!

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