Fedora Linux Support Community & Resources Center
  #1  
Old 8th November 2004, 08:41 PM
ieuuk's Avatar
ieuuk Offline
Registered User
 
Join Date: Oct 2004
Location: uk
Age: 26
Posts: 705
backup script

hi, i have a backup script which goes as follows:

Code:
#!/bin/sh
#
# Back-Up Directory
TIMESTAMP=`date +%Y%m%d_%H%M%S`;     #Year_Month_Day_Hour_Minute_Second
echo $TIMESTAMP;
/usr/bin/rsync --verbose --stats --recursive /server/Mail /server2/Mirror/
/usr/bin/rsync --verbose --stats --recursive /server/Documents /server2/Mirror/
/usr/bin/rsync --verbose --stats --recursive /server/Backup /server2/Mirror/
if [ $? -eq 0 ];then
	echo "bk_OK_$TIMESTAMP" >> /home/ian/sync.log
fi

poweroff
designed to copy my important stuff to another hard drive.. but a problem that i have with it is when it runs... if i have deleted something the backup copy doesnt delete the same file.

any ideas how i can get around this? thanks.
__________________
ieuuk :D

Registered Linux User: #373024
Reply With Quote
  #2  
Old 8th November 2004, 08:47 PM
ilja Offline
Registered User
 
Join Date: Apr 2004
Location: Euregio
Posts: 3,613
Isn't it the main reason for a backup, that the deleted files are not deleted in the backup directory?
__________________
--
http://twitter.com/ik12
Reply With Quote
  #3  
Old 8th November 2004, 08:53 PM
ieuuk's Avatar
ieuuk Offline
Registered User
 
Join Date: Oct 2004
Location: uk
Age: 26
Posts: 705
see your point on that one... i didnt think of it like that

was just wanting it as a copy of whats on the other drive incase of a failure etc.. but i think i will keep it as is now.
could just set it to have a clear out of that directory so that it starts fresh every month or so, so that it doesnt go wild on disk space.
__________________
ieuuk :D

Registered Linux User: #373024
Reply With Quote
  #4  
Old 8th November 2004, 08:57 PM
ilja Offline
Registered User
 
Join Date: Apr 2004
Location: Euregio
Posts: 3,613
read through the man page of rsync. It is very interesting and might help you.

//edit:
e.g.
Quote:
--delete
This tells rsync to delete any files on the receiving side that
aren’t on the sending side. Files that are excluded from
transfer are excluded from being deleted unless you use
--delete-excluded.

This option has no effect if directory recursion is not
selected.

This option can be dangerous if used incorrectly! It is a very
good idea to run first using the dry run option (-n) to see what
files would be deleted to make sure important files aren’t
listed.

If the sending side detects any I/O errors then the deletion of
any files at the destination will be automatically disabled.
This is to prevent temporary filesystem failures (such as NFS
errors) on the sending side causing a massive deletion of files
on the destination. You can override this with the --ignore-
errors option.
__________________
--
http://twitter.com/ik12

Last edited by ilja; 8th November 2004 at 08:59 PM.
Reply With Quote
Reply

Tags
backup, script

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Backup Script @ shutdown shahdharmit Programming & Packaging 0 8th July 2009 06:43 AM
backup to cd script question? crainey69 Using Fedora 0 16th September 2008 02:56 AM
shell script + backup mohdfarah Programming & Packaging 1 16th June 2006 01:05 AM
rsync backup script ieuuk Using Fedora 3 24th July 2005 12:49 PM


Current GMT-time: 22:30 (Tuesday, 21-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat