Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have 2 servers. One is at the main location and the other is off-site. I need to do a scheduled job to copy the entire contents of the server at the main location to the server at the off-site location. I thought I had it, but it isn't working properly, so I need to start from scratch. I keep getting "permissions denied" or "file doesn't exist" messages. If I get the permissions denied, then I have to go to the main server and chmod the file. If I get a file or destination doesn't exist, it's because the remote server doesn't have that subdirectory yet.
Also, the main server is Red Hat 9 and the remote servers are either Red Hat 9 or Centos...if that helps...
I'm just trying to basically backup a server's directory to another server by scheduling a copy. Does the cpio look for archive files? I just need to copy any files that have been modified since the last copy, etc... Does this make sense?
I'm just trying to basically backup a server's directory to another server by scheduling a copy. Does the cpio look for archive files? I just need to copy any files that have been modified since the last copy, etc... Does this make sense?
why dont you just create a cron job to run a bash script that uses rsync to copy the incremental changes as needed if permissions are a different user on the other system you can do this too in rysnc.
learn rsync using man rsync
I hope your not using redhat 9 its extremely old and full of bugs and exploit's please use something more up to date.
look at fedora or redhat enterprise its cheap
So if I am looking at this correctly it would say as follows:
rsync /test/dsk01 joe@remoteserver:/test/dsk01
What are the "OPTION"? Are these switches like you'd use in DOS (ie: xcopy test\*.* e:\test1\*.* /d /e /f) telling the program just to do files that are newer, subdirectories, etc...?
How do I create a cron job to run a bash script and how do I create a bash script?
I know it's alot to probably ask, but I'm new at this and need some help.
BTW-The servers currently are RH9, but we are converting to a newer OS. I just takes time.
So if I am looking at this correctly it would say as follows:
rsync /test/dsk01 joe@remoteserver:/test/dsk01
What are the "OPTION"? Are these switches like you'd use in DOS (ie: xcopy test\*.* e:\test1\*.* /d /e /f) telling the program just to do files that are newer, subdirectories, etc...?
How do I create a cron job to run a bash script and how do I create a bash script?
I know it's alot to probably ask, but I'm new at this and need some help.
BTW-The servers currently are RH9, but we are converting to a newer OS. I just takes time.
I would make sure those rh9 servers are not on the internet at all or accessible if they are they are extremely dangerous.
rsync has many options you need to find which ones fit your needs.
use man rsync to learn more
but in short
1. to create a cron job:
login as root
crontab -e (will open root's crontab)
add job with the timing params (see here http://www.adminschoice.com/docs/cro...Crontab%20file ) ie location of your rsync cmd (shell) file eg /root/my_rsync.sh
2. create a shell file (aka cmd file)
you'll need to learn an editor eg kate, gedit, vim etc
btw, the default editor for the crontab will probably be vi/vim, so learn the basics of that anyway, it's the default Unix editor.
backupsvr.localhost.localdomain: Connection refused
rsync: connection unexpectedly closed (0 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at io.c(150)
PLEASE...SOMEONE HELP!! I'm sure I'm really close, but i need hlpe as to why it's not even asking me for a password. I can ssh into the remote server from the local server also with no problem.
OK. I think I found that I need to install the remote server as a rsync server. I create a rsync.conf file in /etc. Then when I try to run /etc/init.d/rsyncd start it says file not found. Do I need to install this module? How do I do this on RedHat9 and CentOS?
Why don't you run the script on the server that needs to be updated, that way you are not pushing changes. Instead have the 2nd machine pull changes and deletions from the 1st server.
Here is an example for a backing up an asterisk voicemail directory.
Note the above needs to be on one line, very well could be your broken pipe error message.
I use ssh-keypairs to allow secure unattended backups without using a plain text password stored in the script, in this example is also the use of the .exclude file to allow certain items to be excluded during the backup.
That works. I am having a small problem. I think the last one. There is server1 and server2. On both servers there is a /vm/miame/dsk01. When I pull the info with the following:
This creates a dsk01 directory in /vm/miame/dsk01 on server2. So instead of having the contents on server2 to be in /vm/miame/dsk01, it's in /vm/miame/dsk01/dsk01. I can't seem to see what I'm doing wrong...again.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.