[Help] Centos sync folder

soulofangel

Member
Joined
Feb 9, 2013
Messages
234
Reaction score
0
I mounted a window shared drive in my centos (/mnt/win)

i have a folder in my centos "/backup"

I am looking for something like rsync with cron to copy the files in "/backup" to "/mnt/win"


Is this the correct way to do it or are there any better alternative?


Thanks :)
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
I mounted a window shared drive in my centos (/mnt/win)

i have a folder in my centos "/backup"

I am looking for something like rsync with cron to copy the files in "/backup" to "/mnt/win"


Is this the correct way to do it or are there any better alternative?


Thanks :)

Would you want a periodic full backup ? If so, perhaps you don't need a rsync. Just a simple tar command will do

tar -czf /mnt/win/backup-`date +'%F'`.tar.gz /backup

You can always rsync from /backup/ to /mnt/win/ but the problem is it will not preserve the unix filesystem metadata such as the ACL
 
Last edited:

soulofangel

Member
Joined
Feb 9, 2013
Messages
234
Reaction score
0
I already tar monday to sunday.tar.gz of daily full backup (each day is around 2+gb size)
I do not want to keep tarring 10+gb of data everytime i do a backup.
The data increase daily is around 100mb only.
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
I already tar monday to sunday.tar.gz of daily full backup (each day is around 2+gb size)
I do not want to keep tarring 10+gb of data everytime i do a backup.
The data increase daily is around 100mb only.

GNU tar 1.28: 5.2 Using tar to Perform Incremental Dumps

tar -g /var/run/backup.statefile -cvf /mnt/win/backup-full-`date +'%F'`.tar.gz /backup

tar -g /var/run/backup.statefile -cvf /mnt/win/backup-incr-`date +'%F'`.tar.gz /backup
 
Last edited:

soulofangel

Member
Joined
Feb 9, 2013
Messages
234
Reaction score
0
If it's for the purpose of backup.. try take a look at BackupPC?
BackupPC: Open Source Backup to disk

Thanks, but i am looking for a more light weight script.

GNU tar 1.28: 5.2 Using tar to Perform Incremental Dumps

tar -g /var/run/backup.statefile -cvf /mnt/win/backup-full-`date +'%F'`.tar.gz /backup

tar -g /var/run/backup.statefile -cvf /mnt/win/backup-incr-`date +'%F'`.tar.gz /backup

I think this is what i am looking for. So its call incremental backup. Thanks :)
 
Important Forum Advisory Note
This forum is moderated by volunteer moderators who will react only to members' feedback on posts. Moderators are not employees or representatives of HWZ Forums. Forum members and moderators are responsible for their own posts. Please refer to our Community Guidelines and Standards and Terms and Conditions for more information.
Top