doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

Shutdown/data connection loss during RSync operation....

Mon Jul 08, 2013 5:36 pm

What happens to the data if while an RSync operation, there is a power outage or loss in data connection?

Will the data get corrupted?

I have a RasPi at home that is configured as a NAS server. Then I have another RasPi at my office. I want the office RasPi to serve as a mirror of the home RasPi (the home RasPi should always rule so if there are differences, make the office RasPi match it).

My intention has been to create a cron job on the office RasPi that connects via SSH to the home RasPi and then RSync. And assuming the data will not be corrupted, is there a way to resume the cron/RSync operation after the reboot/reconnect?

TIA!

User avatar
rpdom
Posts: 17174
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Shutdown/data connection loss during RSync operation....

Mon Jul 08, 2013 5:55 pm

Rsync is designed for the situation where connections can be lost during transfers.

Just restart the rsync and it will work out what still needs to be transferred.

doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

Re: Shutdown/data connection loss during RSync operation....

Mon Jul 08, 2013 6:17 pm

Thanks. I have a related question though.

When the RasPi boots up, is there a way to have it run any cron jobs that were scheduled to run while the power was out?

User avatar
rpdom
Posts: 17174
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Shutdown/data connection loss during RSync operation....

Mon Jul 08, 2013 6:29 pm

doni49 wrote:Thanks. I have a related question though.

When the RasPi boots up, is there a way to have it run any cron jobs that were scheduled to run while the power was out?
Yes. Install anacron.

"Description: cron-like program that doesn't go by time
Anacron (like "anac(h)ronistic") is a periodic command scheduler. It
executes commands at intervals specified in days. Unlike cron, it
does not assume that the system is running continuously. It can
therefore be used to control the execution of daily, weekly, and
monthly jobs (or anything with a period of n days), on systems that
don't run 24 hours a day. When installed and configured properly,
Anacron will make sure that the commands are run at the specified
intervals as closely as machine uptime permits.
.
This package is pre-configured to execute the daily jobs of the
Debian system. You should install this program if your system isn't
powered on 24 hours a day to make sure the maintenance jobs of other
Debian packages are executed each day."

doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

Re: Shutdown/data connection loss during RSync operation....

Mon Jul 08, 2013 7:00 pm

Thanks a bunch rpdom.

Return to “Beginners”