I am trying to rsync the named files under /etc for backup purposes. I tried:
rsync -ah --stats --delete -e "ssh -p613 -l root" 192.168.192.2:/etc/name* /home/rgm/data/htt/httnet/homebase/new/etc
The stats shows it sees all the files, but only moves the dir /etc/named and the files within it.
It does not move the /etc/name* files (like /etc/named.conf).
By file count, it is 'seeing' all the files, but not moving them.
On Mon, 7 Sep 2015 13:05:59 -0400 Robert Moskowitz wrote:
I am trying to rsync the named files under /etc for backup purposes. I tried:
rsync -ah --stats --delete -e "ssh -p613 -l root" 192.168.192.2:/etc/name* /home/rgm/data/htt/httnet/homebase/new/etc
The stats shows it sees all the files, but only moves the dir /etc/named and the files within it.
It does not move the /etc/name* files (like /etc/named.conf).
By file count, it is 'seeing' all the files, but not moving them.
Hi Robert,
First, a trailing slash specified at the end of the source directory means 'copy everything underneath the specified directory without copying the directory, itself.' Omitting the trailing slash will cause rsync to first create the directory at the target and then copy the specified contents underneath it. Your invocation '/etc/name*' probably needs to be split into successive command strings, one specifying the directory to backup and the other(s) specifying the file(s) under /etc that you want to backup, as well.
Also:
Do you really mean '-h' human-readable vs. '-H' preserve hard links?
Why '-e' (specify remote shell to use)? Are these systems running disparate operating systems?
I use '-v' so rsync echos what it's doing in real time to the terminal as opposed to '--stats', but that's just my personal preference. This allows me to monitor what's going on in real time and to scroll up afterward to review discreet actions after the fact. There is also the '-o' logging capability for those situations where the actions taken might exceed the number of lines buffered by the terminal.
Since '--delete' implies that you will be synchronizing the source and backup directories in future, you might consider setting up public key authentication between the two systems.
Since this is a backup, you really should consider preserving ACLs and extended attributes (-A -X,) too.
Given all of the above, with public key authentication set up, you could then invoke the following command string from the parent directory of the backup (/home/rgm/data/htt/httnet/homebase/new/etc):
rsync -avAX --delete root@192.168.192.2:/etc/named/ named rsync -avAX --delete root@192.168.192.2:/etc/named.conf named.conf ... and so on
hth & regards,
Carl
On 09/07/2015 02:17 PM, Carl E. Hartung wrote:
On Mon, 7 Sep 2015 13:05:59 -0400 Robert Moskowitz wrote:
I am trying to rsync the named files under /etc for backup purposes. I tried:
rsync -ah --stats --delete -e "ssh -p613 -l root" 192.168.192.2:/etc/name* /home/rgm/data/htt/httnet/homebase/new/etc
The stats shows it sees all the files, but only moves the dir /etc/named and the files within it.
It does not move the /etc/name* files (like /etc/named.conf).
By file count, it is 'seeing' all the files, but not moving them.
Hi Robert,
First, a trailing slash specified at the end of the source directory means 'copy everything underneath the specified directory without copying the directory, itself.' Omitting the trailing slash will cause rsync to first create the directory at the target and then copy the specified contents underneath it. Your invocation '/etc/name*' probably needs to be split into successive command strings, one specifying the directory to backup and the other(s) specifying the file(s) under /etc that you want to backup, as well.
Also:
Do you really mean '-h' human-readable vs. '-H' preserve hard links?
Yes.
Why '-e' (specify remote shell to use)? Are these systems running disparate operating systems?
Somewhere I read that is what you need to run this over SSH. Otherwise you need to have rsyncd running on the remote system.
I use '-v' so rsync echos what it's doing in real time to the terminal as opposed to '--stats', but that's just my personal preference. This allows me to monitor what's going on in real time and to scroll up afterward to review discreet actions after the fact. There is also the '-o' logging capability for those situations where the actions taken might exceed the number of lines buffered by the terminal.
Since '--delete' implies that you will be synchronizing the source and backup directories in future, you might consider setting up public key authentication between the two systems.
This is not an automated system. It is typically a onetime thing to get a backup of what I did to set up a server (or the other way around). I have this adversion of leaving my public key all over the place.
Since this is a backup, you really should consider preserving ACLs and extended attributes (-A -X,) too.
Maybe, but then I can't edit it on my system if it is root:named!
Given all of the above, with public key authentication set up, you could then invoke the following command string from the parent directory of the backup (/home/rgm/data/htt/httnet/homebase/new/etc):
rsync -avAX --delete root@192.168.192.2:/etc/named/ named rsync -avAX --delete root@192.168.192.2:/etc/named.conf named.conf
In /etc there are 4 named.* files. Do I have to do each separately?
... and so on
hth & regards,
Carl _______________________________________________ CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
On Mon, 7 Sep 2015 14:58:00 -0400 Robert Moskowitz wrote:
On 09/07/2015 02:17 PM, Carl E. Hartung wrote:
On Mon, 7 Sep 2015 13:05:59 -0400 Robert Moskowitz wrote:
8< - - - - - trimmed - - - - - >8
Do you really mean '-h' human-readable vs. '-H' preserve hard links?
Yes.
Okay, good to know you're cognizant of the difference. ;-)
Why '-e' (specify remote shell to use)? Are these systems running disparate operating systems?
Somewhere I read that is what you need to run this over SSH. Otherwise you need to have rsyncd running on the remote system.
My understanding is that rsync defaults to SSH these days.
8< - - - - - trimmed - - - - - >8
This is not an automated system. It is typically a onetime thing to get a backup of what I did to set up a server (or the other way around). I have this adversion of leaving my public key all over the place.
Then '--delete' is superfluous. It really only comes into play on subsequent synchronizations when files that exist in the target need to be deleted because they no longer exist at the source.
Your public key is only useful when it is paired with the corresponding private key. And, since only you have access to the private key and it resides only on systems where you've installed it, I think your aversion is not well thought out.
Since this is a backup, you really should consider preserving ACLs and extended attributes (-A -X,) too.
Maybe, but then I can't edit it on my system if it is root:named!
Then you're not creating a true 'backup' as I understand the term. :-) In any case, you can still edit these files as root. They'll retain the original attributes when you save them.
8< - - - - - trimmed - - - - - >8
In /etc there are 4 named.* files. Do I have to do each separately?
Two lines, assuming first pass without public key authentication, executed from the parent directory
(/home/rgm/data/htt/httnet/homebase/new/etc)
of the backup that you're creating:
rsync -avAX root@192.168.192.2:/etc/named/ named --> Since the default protocol is SSH, you will be prompted for the remote system's root password.
rsync -avAX root@192.168.192.2:/etc/named.* . --> This will pick up the four named.* files and land them in the local pwd due to the 'dot' passed to rsync as the target.
If you need to 'freshen up' a local snapshot, reinsert the '--delete' flag.
hth & regards,
Carl
I tried your rsync command and it worked on my LAN over ssh. The following was placed in the destination directory:
drwxr-x--- 2 root smmsp 4.0K Jul 28 21:05 named/ -rw-r----- 1 root smmsp 1.6K Oct 30 2013 named.conf -rw-r--r-- 1 root smmsp 2.4K Jul 28 21:05 named.iscdlv.key -rw-r----- 1 root smmsp 931 Jun 21 2007 named.rfc1912.zones -rw-r--r-- 1 root smmsp 487 Jul 19 2010 named.root.key
On Mon, Sep 7, 2015 at 1:05 PM, Robert Moskowitz rgm@htt-consult.com wrote:
I am trying to rsync the named files under /etc for backup purposes. I tried:
rsync -ah --stats --delete -e "ssh -p613 -l root" 192.168.192.2:/etc/name* /home/rgm/data/htt/httnet/homebase/new/etc
The stats shows it sees all the files, but only moves the dir /etc/named and the files within it.
It does not move the /etc/name* files (like /etc/named.conf).
By file count, it is 'seeing' all the files, but not moving them.
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
I ran it again but with:
rsync -ah --stats --delete -e "ssh -p613 -l root" 192.168.192.2:/etc/name* /home/rgm/data/htt/httnet/homebase/new/newetc
And the newetc directory was created with all the files. I again ran:
rsync -ah --stats --delete -e "ssh -p613 -l root" 192.168.192.2:/etc/name* /home/rgm/data/htt/httnet/homebase/new/etc
And none of the /etc/name.* files get moved. Strange.
Well I got my backup.
On 09/07/2015 06:04 PM, Mike wrote:
I tried your rsync command and it worked on my LAN over ssh. The following was placed in the destination directory:
drwxr-x--- 2 root smmsp 4.0K Jul 28 21:05 named/ -rw-r----- 1 root smmsp 1.6K Oct 30 2013 named.conf -rw-r--r-- 1 root smmsp 2.4K Jul 28 21:05 named.iscdlv.key -rw-r----- 1 root smmsp 931 Jun 21 2007 named.rfc1912.zones -rw-r--r-- 1 root smmsp 487 Jul 19 2010 named.root.key
On Mon, Sep 7, 2015 at 1:05 PM, Robert Moskowitz rgm@htt-consult.com wrote:
I am trying to rsync the named files under /etc for backup purposes. I tried:
rsync -ah --stats --delete -e "ssh -p613 -l root" 192.168.192.2:/etc/name* /home/rgm/data/htt/httnet/homebase/new/etc
The stats shows it sees all the files, but only moves the dir /etc/named and the files within it.
It does not move the /etc/name* files (like /etc/named.conf).
By file count, it is 'seeing' all the files, but not moving them.
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos