Hi guys!

I got a TKL Fileserver up and running for almost 6 months now. I am using a cron job to create a local backup of samba shares. I have noticed that the Date Modified of created backup files is the date when the files were created.

cron job: cp -R /mnt/fileserver/File-server /mnt/backup

I'm just wondering if I could leave the Dated Modified of the backup files same with the original files.

Thanks in advance!

Replies (13)

Not sure how you would do that

Reply 1

No doubt there is a way. Perhaps if you tar the files first (not sure if that'd work?) Another work around may be to rename the file to reflect the backup. Just remember that TKL is Ubuntu under the hood so anything that applies to Ubuntu (and to some extent Debian too) should apply to TKL.

Thanks for the reply Jed! I

Reply 2

Thanks for the reply Jed!

I will try using tar balls.

Thanks bob! will try it.

Reply 3

Thanks bob! will try it.

I suspect it's a Mac thing

Reply 5
TurnKey Linux is based on Debian so has GNU versions of tools such as cp. I suspect that as Mac is a proprietary OS, that it doesn't use the GNU variants of these tools so the options probably differ.

As stated...........

Reply 6

in the post by bobmct the '-p' option should preserve ownership and timestamp.

From the man page for cp:

-p     same as --preserve=mode,ownership,timestamps

may bad

Reply 7

sorry...may bad. I thought it was -c.

So in my command.. is it cp -R -c?

-p as in 'peter'

Reply 8

'cp -Rp' or 'cp -R -p'

As far as I know there is no -c option.

errors

Reply 9

I am getting these error...

 

cp -Rp /mnt/fileserver/FS_Backup/File-server/adm/201 /mnt/backup
cp: cannot stat `/mnt/fileserver/FS_Backup/File-server/adm/201': No such file or directory
cp -R -p /mnt/fileserver/FS_Backup/File-server/adm/201 /mnt/backup
cp: cannot stat `/mnt/fileserver/FS_Backup/File-server/adm/201': No such file or directory

my bad again

Reply 10

I was able to sort this out.

case sensitivity caused the error.

cp -R -p /mnt/fileserver/FS_Backup/File-server/ADM/201 /mnt/backup.

Thank you so much Don Sanderson, bob and Jed!

CP is confused

Reply 11

You posted as I was writing this, glad you got it sorted. :-)

 

You will have to examine your file system and see what is wrong with the path:

/mnt/fileserver/FS_Backup/File-server/adm/201

CP can't find, or understand, what you are asking of it.

Just a tought

Reply 12

Hi again Don!

I know I should create a new topic for this question- but I just want to ask on how I can make 2 local fileserver synchronize... from the filesystem to the mounted partions. What I am trying to do is make an exact replica of my current TKL Fileserver which will synchronize with the original at the end of the day.

I have tried TKLBAM but it did not work for me because the internet here is not that good (the disconnects like every 15 minutes, not to mention a very low bandwidth).

Thanks in advance!