LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 06-05-2009, 03:56 PM   #1
deibertine
Member
 
Registered: Mar 2009
Posts: 222

Rep: Reputation: 30
Unhappy Rsync Issue


Hi all,

I'm trying to do backups using rsync. The idea is to backup all of my configs into a windows mounted drive from my unix box so I had this cifs share mounted on /mnt/shared.

I also have a script setup to run every week which has these syntax:
#!/bin/sh
rsync -arz /usr/local/importantdir* /mnt/shared
rsync -arz /usr/local/veryimportantdir* /mnt/shared
rsync -arz /usr/local/absolutelyimportantdir* /mnt/shared
rsync -arz /usr/local/itwouldloosemyjobimportantdir* /mnt/shared

The windows share is mounted via automount in /etc/fstab:
//csaa-dev2/unixbackup /mnt/shared cifs username=asqluid,password=p@r@n01d 0 0

However when I test one of the syntax making sure it runs, I'm getting this error:
rsync: mkstemp "/mnt/shared/.import.log.K4IRFz" failed: Operation not permitted (1)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1039) [sender=3.0.6]

I have permissions setup on both the unix side and most importantly in the windows shared folder to the same username=asqluid,password=p@r@n01d credentials in which from the unix box, I can create/delete a file/folder under the asqluid user.

Can someone please advise me on what's wrong? Am I missing something?

I'd appreciate it!

Thanks,
DB
 
Old 06-05-2009, 04:06 PM   #2
pkraus109
LQ Newbie
 
Registered: Mar 2004
Posts: 23

Rep: Reputation: 16
What are the actual unix permissions on the /mnt/shared. What user are you. It sounds like a permission issue. Try it as root or from sudo just to rule it out.

"I have permissions setup on both the unix side and most importantly in the windows shared folder to the same username=asqluid,password=p@r@n01d credentials in which from the unix box, I can create/delete a file/folder under the asqluid user. "

You can create it from *nix or from windows?

Also make sure you have permission on the source directories aswel. Again doing it as sudo or root will rule out permission issues.
 
Old 06-05-2009, 04:51 PM   #3
deibertine
Member
 
Registered: Mar 2009
Posts: 222

Original Poster
Rep: Reputation: 30
Unhappy Rsync Issue

Quote:
Originally Posted by pkraus109 View Post
What are the actual unix permissions on the /mnt/shared. What user are you. It sounds like a permission issue. Try it as root or from sudo just to rule it out.
"I have permissions setup on both the unix side and most importantly in the windows shared folder to the same username=asqluid,password=p@r@n01d credentials in which from the unix box, I can create/delete a file/folder under the asqluid user. "
You can create it from *nix or from windows?
Also make sure you have permission on the source directories aswel. Again doing it as sudo or root will rule out permission issues.

Ok you kind of gave me an idea there my friend but still having issues.
Well I ran the script under root but got this error:
rsync: recv_generator: failed to stat "/mnt/shared/impt.tar.gz": Permission denied (13)
rsync: symlink "/mnt/shared/xconsole.txt" -> "/usr/local/important/imp.txt" failed: Operation not supported (95)


Here are the permissions under /mnt/shared:
[root@csaa-dev2]# ls -als /mnt/shared
total 400
0 drwxrwxrwx 1 root root 0 Jun 5 13:20 .
8 drwxrwxr-x 3 root root 4096 Jun 5 12:07 ..
0 drwx------ 1 asqluid asqluid 0 Jun 5 13:11 asqluid
0 drwxrwxrwx 1 root root 0 Aug 17 2007 importantdir
128 -rw-r--r-- 1 root root 129719 Mar 4 2008 CollabConsole_archive.txt
0 drwxrwxrwx 1 asqluid3 asqluid3 0 Feb 5 07:40 asqluid3
0 drwxr-xr-x 1 asqluid4 asqluid4 0 Apr 15 11:58 asqluid4
0 drwxrwxrwx 1 root root 0 Jun 5 11:48 F$ILES
0 drwxrwxr-x 2 root root 0 Jun 5 12:08 Rest
8 -rw-r--r-- 1 root root 6960 Jan 9 2004 Reaig.sog
0 drwxr-xr-x 1 root root 0 May 15 2008 asqluid7
256 -rw-r--r-- 1 root root 261970 Jun 4 15:42 asqlbackup.log

Should I change the owner/group permissions on all files/dir in /mnt/shared to asqluid so that the script can write completely to it?

Under asqluid id in my unix box, I can create files/folders no problems in /mnt/shared.

Please advise.

Thanks!
DB
 
Old 06-05-2009, 05:20 PM   #4
david1941
Member
 
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS6
Posts: 267

Rep: Reputation: 58
You might add the --copy-unsafe-links option to rsync

Dave
 
Old 06-05-2009, 05:40 PM   #5
pentode
Member
 
Registered: Dec 2005
Location: Oregon
Distribution: Debian Testing
Posts: 488

Rep: Reputation: 38
"Windows mounted drive"? What filesystem is this drive using? rsync only works with filesystems (for destination) that support hardlinks. Such as a Linux file system (ext3, etc). Certainly won't work on a FAT32 drive (been there, tried that) and I don't think it will work on an NTFS drive.
 
Old 06-05-2009, 05:48 PM   #6
deibertine
Member
 
Registered: Mar 2009
Posts: 222

Original Poster
Rep: Reputation: 30
Ok, I've made a little progress, I think.
After researching on this this it turned out that I need to invoke sudo with rsync.
However having sudo there means I have to add asqluid to the sudoers file which will give the user rights to launch any command in the unix box.

General question: If I add asqluid to the sudoers file, will it have the same rights as root and will be a local admin user to the box?

Getting back to my rsync issue, after launching the script with sudo:
sudo rsync -arzl /usr/local/importantdir /mnt/shared

Now I'm getting this error:
rsync: recv_generator: mkdir "/mnt/shared/Dir/Tration/ava/re/.systemPrefs/com/intraspect/patches/_!$c!.g!x!#4!:!!u!$:!;g!1" failed: No such file or directory (2)
*** Skipping any contents from this failed directory ***

Any idea on what's wrong?

Thanks!
 
Old 06-05-2009, 05:57 PM   #7
deibertine
Member
 
Registered: Mar 2009
Posts: 222

Original Poster
Rep: Reputation: 30
Unhappy Rsync Issue

Quote:
Originally Posted by pentode View Post
"Windows mounted drive"? What filesystem is this drive using? rsync only works with filesystems (for destination) that support hardlinks. Such as a Linux file system (ext3, etc). Certainly won't work on a FAT32 drive (been there, tried that) and I don't think it will work on an NTFS drive.
Thanks for those additional notes.

It's a Windows 2003 server on the share drive so NTFS.

That's weird you said that as it does create "some" of the backup (files/directories/folder) via the script but not understanding on why I'm getting those errors.

Verified after testing the script that it does syncs some of the files in the mounted drive.

I've mounted it via cifs (also tried smbfs).

Any other ideas?
 
Old 06-05-2009, 06:02 PM   #8
deibertine
Member
 
Registered: Mar 2009
Posts: 222

Original Poster
Rep: Reputation: 30
Unhappy Rsync Issue

Quote:
Originally Posted by david1941 View Post
You might add the --copy-unsafe-links option to rsync

Dave
Sorry, no go.

# rsync -arzl --copy-unsafe-links /usr/local/importantdir /mnt/shared
rsync: recv_generator: mkdir "/mnt/shared/importantdir/va/jre/.systemPrefs/com/intraspect/patches/_!$c!.g!x!#4!:!!u!$:!;g!1" failed: No such file or directory (2)
*** Skipping any contents from this failed directory ***
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1039) [sender=3.0.6]
 
Old 06-09-2009, 12:49 PM   #9
deibertine
Member
 
Registered: Mar 2009
Posts: 222

Original Poster
Rep: Reputation: 30
Cant seem to figure this one out.
I have just merged out of rsync and instead used a typical bash script by using "tar" to backup my files.
Here's the tutorial I followed:
http://www.linuxconfig.org/Bash_scripting_Tutorial


Thanks for all the help!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync issue fizeelinux Linux - Newbie 2 12-29-2008 10:47 PM
rsync ISSUE HTELLLP! Stephan_Craft Linux - Server 4 12-14-2008 02:21 PM
rsync permissions issue zeeple Linux - Software 3 11-03-2008 09:13 PM
rsync --files-from issue (v2.6.9) qwertywin Linux - Software 1 08-06-2008 03:06 PM
rsync buffer issue kapilcool Linux - Software 3 10-08-2007 09:34 PM


All times are GMT -5. The time now is 12:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration