Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Returning after a long time, now as a Linux network admin proper, I have a question on cron jobs.
The situation is that I need to synchronize user's home folder to to server. The basics are there and I can do it on my own machine by running a cron job doing rsync between /usr/local/home/<user> and /home/<user> (linking to server:/some-directory/<user>
The job works, so far so good.
However, I want to manage it centrally so that I don't have to go to every machine creating that job, not too mention that if I want to change to schedule, I have to go to every machine again.
What I'm looking for is a cron job that is managed from the server initiating cron jobs on workstations. It would look like
rsync /usr/local/home/$user /home/$user
There will be a period in which some users will still use their present home folders directly at the server and those who will have been set to local home folders with sync to server. There will be a file listing local folder users with their machines.
There will be a schedule that accounts for workstations being left on or turned off (some leaves theirs on for days or longer, other shut down) but I will consider that after I have set it up as a basic cron job.
Well you can just write a cron script centrally that includes an ssh out to each server, or uses a different remote commadn execution mechanism like func, which I think is pretty ace.
I would suggest that the best way to do this is with Puppet, which will let you manage each systems cron job remotely based on all sorts of flexible and useful configurations. Puppet is wonderful, and cures global poverty and all known childhood diseases.
Maybe I got this right, could you have a look at this one:
rsync -a --delete PC01:/usr/local/home/john/ /export/home/john
As oppossed to the first example, I ran this from the commandline of the server. It did what I wanted it to do but it has 2 problems I have to solve:
- Warning: the RSA host key for 'PC01' differs from the key for the IP address '192.168.x.y'
Offending key for IP in /root/.ssh/known_hosts:a
Matching host key in /root/.ssh/known_hosts:b
(a, b, x and y are of course numbers)
Then it asks me to confirm
- root@PC01's password
What is the better approach: trying to solve this (it would make for a somewhat easy way to administer) or still go for a solution where the server remotely initiates rsync jobs?
[which would have this format: rsync -a --delete /usr/local/home/john/ /home/john - the job itself wouldn't go across machines, the mount on the PC takes care of that).
Another option I'm not sure of if it would work:
I create a private/public key pair on the server without a passphrase and export the public key to each workstation to prevent any request for confirmation or password.
I realize I throw a lot of options out, that is because I have scattered knowledge of each of the concepts. As it is I already tried to get to key pair solution to work, no success so far.
What you have in mind are two additonal ways: use ssh-keypair with out a passpharse (or with passphrase and a running ssh-agent) or by mounting all workstations directories on the server.
Running rsync in daemon mode what I suggested is third one. You can define arbitrary users/passwords (these can be random charcaters, as the user need not to exist on the machine, it’s only to access the daemon).