LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-14-2010, 03:39 PM   #1
erics_acvw
LQ Newbie
 
Registered: Nov 2004
Location: Sparks, NV
Distribution: RH7.3, RH8.0, FC10, COS4.5
Posts: 25

Rep: Reputation: 16
cron: rsync /var...--delete?


Hi,

I have two disks on a CentOS 5.4 web server. The second hdc is an exact image of hda. hdc is mounted successfully in fstab. I want to use rsync to back up files from hda6 (/var) to hdc (also /var).

My question is should I use the rsync --delete option? Seems like I should but I'm scared to.

Thanks.
 
Old 02-14-2010, 04:08 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Er.. yes?

rsync -a --delete /var /mount_point_of_hdc/

If you're nervous, run it without --delete but with -v and make sure what happens is what you expect.
 
Old 02-14-2010, 04:52 PM   #3
erics_acvw
LQ Newbie
 
Registered: Nov 2004
Location: Sparks, NV
Distribution: RH7.3, RH8.0, FC10, COS4.5
Posts: 25

Original Poster
Rep: Reputation: 16
Well, it lists bunches of files that will be deleted on the destination, but if they are not on the source, I'd think it's OK. Thill a bit nervous though. There is stuff here I know nothing about and stuff that just plain scares me like "deleting account/" and "deleting mail".

Thanks.

*** Launching RSYNC command (simulation mode):
rsync -r -n -t -p -o -g -x -v --progress --delete --ignore-existing -l -H /var/amavis/ /mnt/backup/var/

sending incremental file list
./
deleting yp/binding/
deleting yp/nicknames
deleting yp/
deleting www/usage/webalizer.png
deleting www/usage/usage_201001.html
deleting www/usage/usage.png
deleting www/usage/msfree.png
deleting www/usage/index.html
deleting www/usage/hourly_usage_201001.png
deleting www/usage/daily_usage_201001.png
deleting www/usage/ctry_usage_201001.png
deleting www/usage/
deleting www/mrtg/mrtg-ti.png
deleting www/mrtg/mrtg-ti.gif
deleting www/mrtg/mrtg-r.png
deleting www/mrtg/mrtg-r.gif
deleting www/mrtg/mrtg-m.png
deleting www/mrtg/mrtg-m.gif
deleting www/mrtg/mrtg-l.png
deleting www/mrtg/mrtg-l.gif
deleting www/mrtg/favicon.ico
deleting www/mrtg/
deleting www/manual/mod/mod_python/icons/up.png
<...>
deleting www/manual/
deleting www/icons/small/uu.png
<...>
deleting www/icons/
deleting www/html/
deleting www/error/include/top.html
<...>
deleting www/error/
deleting www/cgi-bin/
deleting www/
deleting virusmails/spam-zollSgHJUk7R.gz
<...>
deleting virusmails/
deleting spool/virtual/blabla.net/user/tmp/
deleting spool/virtual/
deleting spool/repackage/
deleting spool/postfix/trace/
<...>
deleting spool/postfix/
deleting spool/mail/rpc
<...>
deleting spool/
deleting run/wpa_supplicant/
<...>
deleting run/
deleting preserve/
deleting opt/
deleting nis/
deleting net-snmp/snmpd.conf
deleting net-snmp/
deleting named/slaves/
deleting named/data/
deleting named/pcrat.net
deleting named/num
deleting named/default
deleting named/
deleting lost+found/
deleting log/samba/
<...>
deleting log/
deleting lock/subsys/yum-updatesd
<...>
deleting lock/
deleting local/
deleting lib/yum/
<...>
deleting lib/
deleting gdm/:0.Xservers
deleting gdm/:0.Xauth
deleting gdm/.gdmfifo
deleting gdm/.cookie
deleting gdm/
deleting games/
deleting ftp/pub/
deleting ftp/
deleting empty/sshd/etc/localtime
deleting empty/sshd/etc/
deleting empty/sshd/
deleting empty/
deleting clamav/mirrors.dat
deleting clamav/main.cvd
deleting clamav/daily.cvd
deleting clamav/
deleting cache/yum/updates/packages/
<...>
deleting cache/
deleting amavis/var/
<...>
deleting amavis/
deleting account/pacct
deleting account/
deleting mail
amavisd.lock
amavisd.pid
razor-agent.log
.razor/
.razor/razor-agent.log
.razor/server.c301.cloudmark.com.conf
.razor/server.c302.cloudmark.com.conf
.razor/server.c303.cloudmark.com.conf
.razor/servers.catalogue.lst
.razor/servers.discovery.lst
.razor/servers.nomination.lst
.spamassassin/
.spamassassin/auto-whitelist
db/
deleting db/nscd/
deleting db/Makefile
db/__db.001
db/__db.002
db/__db.003
db/cache-expiry.db
db/cache.db
db/nanny.db
db/snmp.db
tmp/
tmp/amavis-20100125T225952-02777/
tmp/amavis-20100125T225952-02777/email.txt
tmp/amavis-20100125T225952-02777/parts/
tmp/amavis-20100125T230102-02778/
tmp/amavis-20100125T230102-02778/email.txt
tmp/amavis-20100125T230102-02778/parts/
tmp/amavis-20100127T190102-02884/
tmp/amavis-20100127T190102-02884/email.txt
tmp/amavis-20100127T190102-02884/parts/
tmp/amavis-20100127T200101-02885/
tmp/amavis-20100127T200101-02885/email.txt
tmp/amavis-20100127T200101-02885/parts/
tmp/amavis-20100204T220102-02700/
tmp/amavis-20100204T220102-02700/email.txt
tmp/amavis-20100204T220102-02700/parts/
tmp/amavis-20100204T230101-02701/
tmp/amavis-20100204T230101-02701/email.txt
tmp/amavis-20100204T230101-02701/parts/
tmp/amavis-20100214T130102-02873/
tmp/amavis-20100214T130102-02873/email.txt
tmp/amavis-20100214T130102-02873/parts/
var/

sent 1390 bytes received 166 bytes 3112.00 bytes/sec
total size is 945300 speedup is 607.52 (DRY RUN)
 
Old 02-14-2010, 05:25 PM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
The delete option will create an exact copy of the source at the destination.
So if you delete a file on the source, it will be deleted on the destination also.
If you create a new file at the source, it will be created at the destination.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron and Rsync SimonTHK Linux - Software 16 10-07-2009 03:09 AM
rsync and cron numtre Linux - Software 1 01-08-2009 06:54 AM
/var/log/messages and /var/log/cron not working sigkill Linux - Software 6 08-09-2008 01:08 PM
rsync doesn't seem to delete cooks44 Linux - Software 10 11-21-2007 11:57 PM
rsync --delete question Red Squirrel Linux - Software 2 10-10-2005 09:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration