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!
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.
michaelk: Yes, I did enable sftp/ssh via the control panel in the NAS. I'm not following you on the rest about the .ssh keys. Right now, I am trying to rync as root, which works for some directories and not others as illustrated in my last post. However, I do anticipate that I will need to address the issue that you brought up about .ssh keys and will have to figure out how to automate this process by ssh-copy-id, later.
This interfaces with the rsync daemon if I'm not mistaken, rather than going through ssh. So your arguments are conflicting and likely the rsync daemon doesn't have permission to write to /system/MachineName/stage/datafolder. If you want to go through ssh, you should only have one colon.
Also, where exactly are you trying to dump these files? ~/backups/system/MachineName/stage or /backups/system/MachineName/stage or /system/MachineName/stage or what?
I found one of the problems with respect to the Time Stamp pertaining to the -a argument for Rsync:
>rsync -rav ....
>rsync -rv ...
then it don't get the time stamp problem, and the Rsync works. Why did it work on the testfolder with -rav and not with the datafolder?
I even tried chmod 775 and 777 on the datafolder directory and it didn't work with -rav.
Last edited by tearsforhari; 05-19-2015 at 01:53 PM.
Yes, indeed. If I use the one semicolon with / AND include the volume1 directory:
>rsync -rav -e ssh --remove-source-files /home/ftp_user/stage/201503 root@IP:/volume1/backups/system/MachineName/stage
Everything is good, even with the time stamps.
Or, to summarize, I can use:
>rsync -rv -e ssh --remove-source-files /home/ftp_user/stage/201503 root@IP::backups/system/MachineName/stage
And everything works without the time stamps.
I'm having trouble automating the system with ssh-keygen and ssh-copy-id, though. Could you help?.
ssh: Could not resolve hostname IP:/backups/system/fd-lso-alice/stage: Name or service not known
Last edited by tearsforhari; 05-19-2015 at 03:39 PM.
I can ssh to the NAS as root, and there is indeed a directory /root that I can cd to. The .ssh file is empty. I got the following errors:
> ssh-copy-id firstname.lastname@example.org:/root/.ssh
ssh: Could not resolve hostname 220.127.116.11:/root/.ssh: Name or service not known
> ssh-copy-id email@example.com:/root
ssh: Could not resolve hostname 18.104.22.168:/root: Name or service not known
I can do the following that works:
> ssh-copy-id firstname.lastname@example.org
(fine, no password needed)
I got it!! My problem was that I needed to invoke the following Rsync command:
Ok, one more follow-up question that was asked of me above:
Me: 2. How would I go about setting rsync and sshkey-gen on a third party linux box, where computer 3 accesses files from computer 1 and transfers them to computer 2?"
Evo: What do you mean by "setting"? Do you mean installing? If so, then by using the package manager for that system. Why does there need to be a 3rd computer in this scenario? Why can't you copy directly from computer 1 to computer 2?
Well, I probably could do it that way. But I am trying to re-create a shell script that used computer 3 to perform back ups of several other computers 1, 2, 4, 5 etc. How would my script be diiferent? Would I ssh-copy-id from computer 3 to all the other computers?
Last edited by tearsforhari; 05-19-2015 at 03:47 PM.
Help. I really need to rsync from computer1 to computer2, using computer3. I am trying to sync a directory in two computers. I tried the following command on computer3:
>rsync -rav -e ssh email@example.com:/home firstname.lastname@example.org:/volume1/backups/
The source and destination cannot both be remote.
rsync error: syntax or usage error (code 1) at main.c(1166) [Receiver=3.0.9]
Which means you can't do it. You have two options:
1) computer3 sshs into computer1 and tells it to rsync to computer2 directly (or vice versa)
2) computer3 rsyncs from computer1 to a temporary location on computer3, then rsyncs from that temporary location to computer2
2 - That's not what I mean, but sshfs could work too
3 - You're mixing up flags. There's no point in -a on the second rsync if it's not on the first, and without the recursive flag set on the first you'll skip all directories (-r is included in -a). You also have -e, but no argument for it. ssh is implied, unless you need to modify the ssh parameters just leave "-e ssh" off entirely. You also don't have a path for your destination.
Watch the trailing slash on the source location in rsync. Unlike most other Linux commands the presence/absence of that trailing slash DOES make a difference in rsync. I left it off in my examples, but you may need it, it all depends on your directory structure at the source and destination, and what, exactly, you intend to copy over.
Last edited by suicidaleggroll; 05-21-2015 at 03:14 PM.