rsync not working
I am going crazy with a problem that seems really easy to resolve. This code works fine:
Code:
rsync -av /home/randy/chuo-radio-shows/ randy@192.168.2.18:/media/masterlps/chuo-radio-shows Code:
randy@watt0s:~$ rsync -av /home/randy/chuo-radio-shows/ randy@192.168.2.14:/media/nic/chuo-radio-shows |
is it mounted when you try to run the rsync command? if its not mounted before the rsync command, rsync will not mount it for you.
|
Yes. /media/nic is mounted. I can use the drive from pcmanfm with no problems.
|
What happens when you run the following?
ls -la /media/nic/chuo-radio-shows Or the following? touch /media/nic/chuo-radio-shows/file Also, when you run rsync, make sure to keep consistent with how you end your source and dest dirs. If you have a trailing slash for one, add a trailing slash for the other. |
I tried with and without the trailing slash as well. Same thing.
Code:
randy@watt0s:~$ ls -la /media/nic/chuo-radio-shows Code:
randy@watt0s:~$ touch /media/nic/chuo-radio-shows/file |
So it appears that /media/nic is the mount point for /home/nic (or /home/randy) on 192.168.2.14. The rsync command posted does not use mount point in your fstab and would reference the path /media/nic/chuo-radio-shows on 192.168.2.14 which probably does not exist.
You can rsync between mounted directories or use the actual path on 192.168.2.14. |
I should have clarified. I meant run these commands on the destination host (not the one you are running the rsync command on).
What happens when you run the following? ls -la /media/nic/chuo-radio-shows Or the following? touch /media/nic/chuo-radio-shows/file |
Code:
results |
The command you posted would copy all files from the directory /home/randy/chuo-radio-shows/ on your local machine to the directory /media/nic/chuo-radio-shows on 192.168.2.14. Since 192.168.2.14 does not have a /media/nic/chuo-radio-shows directory, the command fails.
So, what is it exactly that you're trying to accomplish here? |
1 Attachment(s)
There are the three instances where I am using rsync. The first two work great. The last one doesn't.
Code:
#sync chuo-radio-shows folder Code:
# /etc/fstab: static file system information. |
It looks like you are mounting /media/nic from the destination to the source:
//192.168.2.14/home /media/nic cifs credentials=/home/randy/.smbnicole,uid=1000,gid=1000,iocharset=utf8,sec=ntlm 0 0 Try this instead: rsync -av /home/randy/chuo-radio-shows/ /media/nic/chuo-radio-shows/ You already mounted it right? You don't need to have rsync go to the server and look for the path (that does not exist). You can simply copy from your local source to the mount point on the local source. |
Alright, it looks like you're just confused about how network shares (and perhaps mounting in general) work on Linux.
When you mount a network share, for example //192.168.2.14/home to /media/nic, the remote directory 192.168.2.14:/home becomes available locally at /media/nic. 192.168.2.14:/home/myfile can be accessed locally at /media/nic/myfile. You seem to be combining the remote access and the local access verbage in your rsync call. If you want to sync /home/randy/chuo-radio-shows on your local machine to /home/chuo-radio-shows on 192.168.2.14, you can do it using either: Code:
rsync -av /home/randy/chuo-radio-shows/ /media/nic/chuo-radio-shows/ Code:
rsync -av /home/randy/chuo-radio-shows/ 192.168.2.14:/home/chuo-radio-shows/ You CANNOT reference your LOCAL mount point on the REMOTE filesystem, however, which is what your earlier rsync command was attempting to do. There is no /media/nic/chuo-radio-shows on 192.168.2.14, it doesn't exist. /media/nic/ on your LOCAL filesystem is a remote mount of 192.168.2.14:/home, so when YOU reference /media/nic/chuo-radio-shows on your LOCAL filesystem, you're actually pointing to 192.168.2.14:/home/chuo-radio-shows. You need to pick which way you want to reference the remote destination. Do you want to transfer through the CIFS mount? If so, use the first rsync syntax I provided above by pointing to the mount point on your local filesystem. Do you want to transfer through rsync's default remote transfer protocol (eg: ssh)? If so, use the second rsync syntax I provided above by pointing to the remote location on the remote machine directly. Your first two commands are only working because of a fluke. Those directories just happened to exist there, either through some freak coincidence, or because you created them for some reason. They should all be failing like the third one is. |
Hi suicidaleggroll,
Thanks so much for clearing this up. I will try out both methods you described and post back. I see exactly what you are talking about now and I understand! Wow! I love learning all about Linux even though my brain gets confused at times. I have a question. When I set up my fstab for 192.168.14 does connect regardless of who the user(s) are at the other end or is this defined in the creadentials file I created and included in the fstab entry? |
The cifs entry in fstab will be mounted using the credentials you provide.
If these are all Linux systems though, I would highly suggest avoiding samba and cifs and just use NFS though. NFS will handle linux file access and user permissions much cleaner than samba will, since samba is built for sharing with windows systems (and the user permission hell that entails). With NFS, just make sure your user "randy" has the same UID on all machines, and file ownership and permissions will cross over seamlessly. |
Thanks! I just wanted to make sure that I had it rock solid clear in my head. I tried rsync out and it works fine now. Glad I went through this learning process. Thank you so much!!! :)
|
All times are GMT -5. The time now is 07:22 AM. |