FW: Need help figurinig out rsync
am 19.04.2004 22:10:37 von Eve Atley
The previous system administrator set up a backup script like the one below.
(I commented out the script so it wouldn't run) I was told about rsync and
would like to use it in a similar way. The original script:
#!/bin/sh
#backup_main: simple backup routine to be used with samba and bash cp.
#this one simply copies an entire directory recursively to an smb mount.
#
#written by RKL - 7/17/2003
#mount -t smbfs -o
username=linuxadmin,password=somepassword,workgroup=wowcorp //BACKUP/backup
/mnt/backup &>/root/backup_scripts/logs/`date +"MOUNT-%y-%m-%d.log"`
#if [ -f /mnt/backup/connected ]; then
# rm -rf /mnt/backup/`date +"%A/"`
# mkdir /mnt/backup/`date +"%A/"`
# cp -r /home/* /mnt/backup/`date +"%A/"` 1>/mnt/backup/logs/`date
+"DAILY-%y-%m-%d.log"` 2>/mnt/backup/logs/`date +"DAILY-%y-%m-%d.err"`
# umount /mnt/backup &>/root/backup_scripts/logs/`date
+"MOUNT-%y-%m-%d.log"`
#fi
Based on an example at the official rsync site, I'd like to do something
like they've listed, but am not sure what settings i need to transfer over
to the new script. I want to:
a. backup /home/shared to a SPECIFIC Windows 2000 drive on a system called
BACKUP.
b. know what my rsync_password is; is this different from the password in
the above script?
c. do I need to add 'fi' at the end of the script as above?
#!/bin/sh
# This script does personal backups to a rsync backup server. You will end
up
# with a 7 day rotating incremental backup. The incrementals will go
# into subdirectories named after the day of the week, and the current
# full backup goes into a directory called "current"
# directory to backup
BDIR=/home/shared
# excludes file - this contains a wildcard pattern per line of files to
exclude
#EXCLUDES=$HOME/cron/excludes
# the name of the backup machine
BSERVER=BACKUP
# your password on the backup server
export RSYNC_PASSWORD=somepassword
############################################################ ############
BACKUPDIR=`date +%A`
OPTS="--force --ignore-errors --delete-excluded --exclude-from=$EXCLUDES
--delete --backup --backup-dir=/$BACKUPDIR -a"
export PATH=$PATH:/bin:/usr/bin:/usr/local/bin
# the following line clears the last weeks incremental directory
[ -d $HOME/emptydir ] || mkdir $HOME/emptydir
rsync --delete -a $HOME/emptydir/ $BSERVER::$USER/$BACKUPDIR/
rmdir $HOME/emptydir
# now the actual transfer
rsync $OPTS $BDIR $BSERVER::$USER/current
====================================
- Eve Atley
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
ping: unknown host ?
am 21.04.2004 03:17:59 von chuck gelm net
This is a multi-part message in MIME format.
--------------090101040903000702060002
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Howdy, Y'all:
My host, 'router', seems to not be resolving host names to IP addresses.
I can ping by IP address, but not by domain name. i.e.
ping 206.141.251.2
is find, whereas
ping gelm.net
fails with error:
ping: unknown host gelm.net.
This is my router (DSL<>LAN) and is functioning as the local
domain name server, but cannot serve its self. ?
Attached is the output of
netstat -r
route -n
resolv.conf
What is not working?
Chuck
--------------090101040903000702060002
Content-Type: text/plain;
name="netstat.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="netstat.txt"
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
68.254.31.254 * 255.255.255.255 UH 0 0 0 ppp0
localnet * 255.255.255.0 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default 68.254.31.254 0.0.0.0 UG 0 0 0 ppp0
--------------090101040903000702060002
Content-Type: text/plain;
name="resolv.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="resolv.txt"
nameserver 206.141.251.2
--------------090101040903000702060002
Content-Type: text/plain;
name="route.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="route.txt"
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
68.254.31.254 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 68.254.31.254 0.0.0.0 UG 0 0 0 ppp0
--------------090101040903000702060002--
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: ping: unknown host ?
am 21.04.2004 04:05:42 von Ray Olszewski
At 09:17 PM 4/20/2004 -0400, chuck gelm wrote:
>Howdy, Y'all:
>
> My host, 'router', seems to not be resolving host names to IP addresses.
>
> I can ping by IP address, but not by domain name. i.e.
>ping 206.141.251.2
> is find, whereas
>ping gelm.net
> fails with error:
>ping: unknown host gelm.net.
>
>This is my router (DSL<>LAN) and is functioning as the local
>domain name server, but cannot serve its self. ?
>
>Attached is the output of
>netstat -r
>route -n
>resolv.conf
>
> What is not working?
Well, /etc/resolv.conf says that the router is to use 206.141.251.2 as a
resolver. And you seem to say above that the router can ping that IP
address, which tells us that routing to it is OK. Possibilities I can think
of are:
1. What is 206.141.251.2 ? I'm surmising that it is your ISP's nameserver.
Do you know that it is a working resolver (to ask the most basic detail
question, does it ACCEPT traffic to port 53/UDP)?
2. Are you running any firewalling on your host that might be interfering
with traffic to or from the resolver? Checking this is somewhat kernel
specific; if you are running 2.4.x, then check with
iptables -nvL
iptables -t nat -nvL
It is quite possible that your default table DENYs or REJECTs DNS traffic
to and from the router itself, while your nat table ACCEPTs it to and from
LAN hosts.
3. HOW is the router "functioning as the local domain name server"? Is it
running BIND (named)? dnscache? Something else? However it provides DNS to
the LAN, you do not have it set up to use that method for itself, since the
entry (below) in /etc/resolv.conf points to what I assume is an off-LAN
nameserver.
One other detail: please ALWAYS report the routing table with "netstat
-nr", or an equivalent that reports addresses, not names. YOU know what IP
address network "localnet" translates too, but WE do not ... I've been
assuming that this router NATs a private-address LAN (e.g.,
192.168.1.0/24), but your reporting by network name conceals that
information. And if my guess is wrong, a lot else that I said could easily
also be wrong.
>Chuck
>
>
>Kernel IP routing table
>Destination Gateway Genmask Flags MSS Window irtt Iface
>68.254.31.254 * 255.255.255.255 UH 0 0 0 ppp0
>localnet * 255.255.255.0 U 0 0 0 eth0
>loopback * 255.0.0.0 U 0 0 0 lo
>default 68.254.31.254 0.0.0.0 UG 0 0 0 ppp0
>nameserver 206.141.251.2
>Kernel IP routing table
>Destination Gateway Genmask Flags Metric Ref Use Iface
>68.254.31.254 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
>192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
>127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
>0.0.0.0 68.254.31.254 0.0.0.0 UG 0 0 0 ppp0
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs