DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-07-24 03:45:58

rcblackwell
Member
From: Pickering, ON
Registered: 2008-05-19
Posts: 204
Website

Urgh!! ffp on USB Out Of Sync with ffp on HD

Based on scripts found in this forum, some time ago I modified fun_plug so a USB thumb drive was mounted during the boot process. Also as part of the configuration process ffp was configured so it run from the USB drive unless for some reason the USB drive failed to initiate. When the USB drive fails to initiate, ffp runs from the HD.

Tonight while installing packages associated with UPS support I realized files stored in the ffp directory on the USB drive no longer are in sync with those found in the ffp directory of the HD (/mnt/HD_a2/ffp).

Being somewhat new to Linux I'm unfamiliar with all the commands. I thought of using the copy command with the -p and -r switches; copy files from the USB drive to the HD then copy them from the HD to the USB drive. This would be achieved using cp -p -r /mnt/USB/ffp/* /mnt/HD_a2/ffp  and then using  cp -p -r /mnt/HD_a2/ffp/* /mnt/USB/ffp to bring the directories up to date.

I know this approach will mess up log files and any other file that have been modified since first copying ffp from HD_a2 to the USB drive however I feel there would be little impact as many, if not all installs and updates have been performed with the USB Drive active (Thus the reason for starting the CP command with the USB drive)

Is there a better way to synchronize the two directories? I thought of rsync but could not figure out the switch and path detail.

Bob Blackwell
Pickering, ON

Last edited by rcblackwell (2008-07-24 03:46:27)


Bob Blackwell
Pickering, ON

Offline

 

#2 2008-07-24 04:02:55

silversurfer
Member
Registered: 2008-07-20
Posts: 95

Re: Urgh!! ffp on USB Out Of Sync with ffp on HD

I would not use the copy method, at least not the way you intend to.  If you would do it like that then you will also copy "zombies" (e.g. leftovers from previous installations) from your HD to the USB stick. This will mess up your installation. If you normally use the stick and this is your most current version of ffp why not do this? ->

rm -r /mnt/HD_a2/ffp
cp -r /mnt/USB/ffp  /mnt/HD_a2/

For me this would be the best solution.

Offline

 

#3 2008-07-24 15:04:18

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 1178

Re: Urgh!! ffp on USB Out Of Sync with ffp on HD

cp -a /mnt/USB/ffp  /mnt/HD_a2/ is  the better alternative because it a) preserves file attributes and b) copies symlinks as well.

Offline

 

#4 2008-07-24 15:07:16

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Urgh!! ffp on USB Out Of Sync with ffp on HD

KyleK wrote:

cp -a /mnt/USB/ffp  /mnt/HD_a2/ is  the better alternative because it a) preserves file attributes and b) copies symlinks as well.

I'd use

Code:

rsync -av --delete /mnt/USB/ffp /mnt/HD_a2

This will not only preserve attribs and links, but also delete obsolete files from /mnt/HD_a2. You can also 'test' it by adding '--dry-run' after '--delete' to first see what it will actually do.

Offline

 

#5 2008-07-26 01:49:11

rcblackwell
Member
From: Pickering, ON
Registered: 2008-05-19
Posts: 204
Website

Re: Urgh!! ffp on USB Out Of Sync with ffp on HD

rcblackwell wrote:

Is there a better way to synchronize the two directories?

I'm in sync once again. Many thanks to all.

Bob Blackwell
Pickering, ON


Bob Blackwell
Pickering, ON

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB