rclone sync will purge destination if source unmounts while sync is running
What is your rclone version (output from rclone version)
rclone v1.50.2
os/arch: linux/amd64
go version: go1.13.6
Which OS you are using and how many bits (eg Windows 7, 64 bit)
Ubuntu 20.04.2 LTS
rclone sync /mnt/Drive1 /mnt/Drive2
Hi,
I'm regularly running a cron job that triggers a rclone sync for backup purposes (been doing so flawlessly since a few years).
Recently, the source drive unmounted by itself for an unknown reason (maybe a prefail symptom).
By consequence the location of the source, that was like /mnt/drive1 became empty.
You imagine the rest.
rclone continued its task as rigorously as it always does, and proceeded to overwrite the backup as an empty folder... !!
Luckily I was monitoring, realized what was going on, and killed the process. Even more luckily the source drive had not unmounted because it had died... (And I also have a less regular 3rd backup sync to a remote location). I was able to recover all data and replicate it once more (≈10TB).
But the whole thing came as a shock.
I must find a way to check the mount status of the drive that is being backuped up... and get rclone to stop if it does...
Whether the drive is prefailing and needs replacement or not does not change that fact for the future.
The question is how ??
This might be more of a bash script question than specifically rclone, what do you think ?
Hi !
Thanks for this.
I ran through it sideways and I have the feeling this would help me check if the drive is mounted before running rclone sync.
But what if it unmounts during the actual rclone sync ?... (usually lasts about 30minutes to 2 hours on average for my cron job).
I know... it's not good. As I mentionned initialy it feels like a prefail symptom.
It has been running smoothly 24/7 for the past year. And appears to have unmounted several times recently.
The extended SMART check reports nothing, no bad sectors, nothing above thresholds. report is healthy. I just don't know.
I am of course considering to replace the drive.
But the experience still makes me want to solve this one
Also, by the time I solve what seems to be a hardware issue, does not mean I should stop backups, so...
The difficulty here is that I would litteraly need to check mount status between each synced file !...
You are so right. Thank you.
Fundamentally I am using rclone improperly.
Makes me realise how I've been using it to avoid the investment in a proper raid array...