0

I am looking for a way to check if files were added/deleted/updated on a network shared HDD without spinning it up if possible.

First I will start with my set up. I have an Asus Router (running Merlin) with a 3.0 usb port connected to a HDD (call it HDD1) shared using the build in Samba share. I then have a raspberry pi 3 (only with usb 2.0 ports) connected to the router through ethernet. The pi also has its own HDD (call it HDD2) connected to it. I have HDD2 as a backup of HDD1 using rdiff-backup and the HDD1 mounted to a folder within the pi. Using a cronjob, I have weekly backups made. I noticed though when calling rdiff-backup to do a check, it has to spin up both drives even if there is no change. May not be much but to strive for the most life long drive, I would like it to spin up less, especially if I have not touched the shared drive in say weeks.

My initial thoughts were to use something like inotify to make the calls to rdiff-backup only when files change but reading the man page, it does not work over the network and has to do "polling" to check. Doesn't really solve the issue and the derivatives to inotify all seem to build off of it, which entails still not working over network.

My second idea is to add some script to the router that makes some call to the pi when the hard drive has any file changes and then the pi would know to maybe later that night to do a rdiff-backup sync, but I feel that is over complicating the situation and I don't yet have a full plan of how I would do that.

Third option is to have both hard drives connected to the pi, but then I am limited to 2.0 usb speeds.

Does anyone have any idea's/suggestions?

Kayracer
  • 11
  • 1
  • 3
  • How would you read from the harddrive to know the state of the files, without spinning it up? I guess what you could do is keep a local "state" file which contains the info from the last run and compare to that - however, this could be outdated if the remote changed by other means – Panki Jul 31 '21 at 11:36
  • @Panki so sometimes I noticed I can browse the file system until I either go to deep or open a file, where then it spins up the disk. I am assuming either the HDD or router is cacheing the structure somewhere and think if I could maybe use that. And what you kind of said, maybe some way setting a flag for when the HDD is spun up and changed files for the pi to see later and do the back up. – Kayracer Jul 31 '21 at 13:42

0 Answers0