1

The backup process of my hard drive in my laptop takes a very long time which I haven't measured and can't estimate. Sometimes I would like to suspend the backup process, so that I can suspend my OS Ubuntu and bring it to some other place by taking a bus, or I can do something else under Ubuntu without being bothered by the backup process.

Can I suspend a backup process by rsync, then umount and unplug the backup storage device, then reattach and mount the device, and finally resume the backup process by rsync?

Will the resumed process by rsync work, except that it doesn't back up any change made during the detached period to the files already backed up?

Is restarting rsync command after reattach and mount the external storage device, the only solution?

Thanks.

2

No.

The rsync process, even though suspended, has open files on the backup drive. With a process having opened files on a drive, you can't (and shouldn't) unmount it.

If you forced an unmount of the drive, it is highly unlikely that the rsync backup job would be able to complete when reattaching the drive and unsuspending the process. It may corrupt the filesystem, requiring you to run fsck on it.

  • Thanks. Is restarting rsync command after reattach and mount the external storage device, the only solution? – Tim Jan 17 '17 at 8:08
  • @Tim I would say so. – Kusalananda Jan 17 '17 at 8:09
2

You're unlikely to be able to find a window of opportunity to suspend rsync without it having a file or directory open on your removable media. And if there is a file or directory open on the removable media you won't be able to unmount it cleanly. And if you don't unmount it cleanly you can't guarantee that all file I/O has been written to the disk.

You would be far safer killing the esync, and then restarting it.

  • Thanks. Is restarting rsync command after reattach and mount the external storage device, the only solution? – Tim Jan 17 '17 at 8:08
  • @Tim I don't know of any other solution. Is it a problem to restart the rsync? If no changes have been made to your sources it shouldn't take long for it to skip over the files it's already copied. If that's not happening maybe your rsync settings aren't quite right for your scenario. – roaima Jan 17 '17 at 8:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.