Software :: RHEL 5.5 - Rsync Not Retaining Permissions
Jan 28, 2011
I've got an older RHEL 5.5 server that we're using for our company email server. We're going to retire this server and I've created a new Debian Linux server as it's replacement. Now I'm trying to rsync all the users /home/ directories to the new server however when I tested this, I noticed a problem. In the old source server where I'm running the actual rsync command from, everyone's home directory is owned by their unique UID and a generic GID (100 = users). So when I execute this command on the old RHEL 5.5 server:
Why are all the users home directories being owned by root:root on the target server? It's not owned by root:root on RHEL 5.5 and the only thing I can think of is my rsync command is wrong. According to the man page, I can see that using the -a switch should preserve all file ownership and much more. It's not doing this on the target Debian server. If it tries to copy over /home/bob and it's owned by bob:users, if Debian didn't know or have a UID for Bob, wouldn't it just assign a UID from RHEL 5.5 to the Debian server? So like /hone/bob would be owned by 1009:users?
I got two ubutnu servers running side by side, I need to transfer several dir's of files, incl sub dirs to the other server via ftp and retaining the file permissions and dir structure. Both servers have ftp access, I am assuming theres an ftp command I use on the destination server to connect to the source server and retrieve the files? All the files reside in the one dir and need to be copied to the same dir on the destination server.
Problem: permissions for rsync and BackinTime. Setup: Ubuntu 11.04, Two internal HD, #1=main, single boot, #2=backup drive. Question: How do I set up my 2nd HD with correct permissions? Background: I had previously a dual boot XP+10.04 with a 2nd HD formatted as NTFS. With this I was able to use my rsync and backintime to my 2nd HD with no issue. My new set up is EXT4 on both HD.
(I even tried to reformat my 2nd HD as NTFS, but that didnt fix the issue) I followed [URL] to mount the 2nd HD and get permissions. But now when I run backintime i get this error: [E] Error: rsync: opendir "/home/myhome/.ssh" failed: Permission denied (13) I did my requisite reading for a newbie, and am stuck. I ran backintime as root, and it backed up ok. How do I run my user version of backintime? (i.e. How do I fix the permission issue?)
I'm trying to learn how rsync works to backup my system. I tried: Code: rsync -azvv /home /media/Elements I get a folder called home on my external hard drive but when I use ls -l to see the permissions they are all wrong. On my /home folder the permissions for /nathan are drwxr-xr-x 48 nathan nathan The permissions on the backup /nathan folder are drwx------ 1 nathan nathan
I also tried using the long version of -a which is -rlptgoD and that didn't work either. What do the 48 and 1 mean when I used ls -l? When I look in the /nathan folder the permissions are all screwed up too. A lot of the files are backed up as executable and the permissions are all screwed up. I also ran it with sudo, and that didn't work either. The permissions were still screwed up and ownership is messed up too.
I know rsync generates a lot of questions, but I have not found an answer to this one about whether the archive option (rsync -a) ever misbehaves. I am transferring data from field instruments running Debian etch to a central server running Debian lenny. My command is below: Code: rsync -av --remove-source-files --log-file=rsync_20110612_0656Z.log ./20100616/ archive@bigserver:/mnt/ZAP_DATA/20100616/zap2/
After rsync runs, the directories it touches on bigserver have very strange permissions as follows: Code: d-wxrw--wt 2 root root 4.0K 2010-10-26 04:31 20101026
This says that directory 20100226 can be written by anybody, but can't even be read by its owner! I thought rsync was messing things up, but in the process of writing this question I discovered that the original files that I am trying to sync have these crazy permissions. So I no longer have a question, but if future LQers think that rsync -a is messing up their permissions, this post may confirm that it is merely copying their messed up permissions from somewhere else, as it is supposed to do!
am trying to sync data from Server A to Server B. The destination on Server B is a CIFS share and I need to preserve timestamps, permissions, etc. on all the data that I transfer. During the rsync process, I receive thousands of errors like the one below: rsync: chown "/LBDCASAN001/JasonHarper/files/1259810304676/2010-12-22-01-00-03/0x22/0xc8/0x43/0x0a" failed: Permission denied (13)
I'm not sure if it's related at all, but my mount point on Server B has the permissions set as: drwxr-xr-x 2 root root when it is unmounted. When I mount the CIFS share, the mount point permissions change to: drwxrws---+ 3 root root
Also, here is the line from my /etc/fstab that mounts the share: //X.X.X.X/LBXXXXX001 /LBXXXXX001 cifs username=LBXXXXX001,password=XXXXXXX!,uid=0,gid=0 0 0 When I perform the rsync, I'm authenticating to Server B from Server A as root.
I am using Rsync to backup files to a another machine, the users on my fileserver do not exist on the backup server so Rsync throws errors about the permissions. It copies the files fine but I want to get rid of the errors and have Rsync ignore the permissions when backing up. /backup is a mounted ftp directory
Below is the current command and output: Code: root@Fileserver:~# rsync -av --delete /shared/fileshare/ /backup/backup building file list ... done created directory /backup/backup ./ manager/ ..... rsync: chown "/backup/backup/manager/.chironfs.txt.c6MbJ7" failed: Operation not permitted (1) rsync: chown "/backup/backup/manager/.cronman.txt.hdBG4P" failed: Operation not permitted (1) ..... sent 211115 bytes received 274 bytes 7686.87 bytes/sec total size is 210263 speedup is 0.99 rsync error: some files could not be transferred (code 23) at main.c(977) [sender=2.6.9]
I am using rsync to backup data from a file server to a external device, the data is accessed from windows boxes via samba with their own usernames, user1, user2 etc... Rsync is failing to copy the file permissions when sending to the external device, I have tested sending to a ftp server and a usb hard drive and received the same error, see below:
Code: root@Fileserver:~# rsync -avz --delete-after /shared/fileshare/ /backup/backup building file list ... done ./ manager/ rsync: chown "/backup/backup/manager/cronman.txt" failed: Operation not permitted (1) public/ ..... sent 339 bytes received 104 bytes 886.00 bytes/sec total size is 4593 speedup is 10.37 rsync error: some files could not be transferred (code 23) at main.c(977) [sender=2.6.9] When I backup to a local directory the permissions are copied correctly.
I try to use rsync for backing up some directories and I have to following problem: some files have permissions that prevent me from running rsync under my own user id. So I run it under root using the option "-a" which according to the man page should preserve the permissions, owner and group information:
However, when I run this under root, the directories created in the backup location get user root and group root while ordinary files keep the original user and group. What am I missing here? How can I get rsync to preserve the user and groups for all files, including directories?
Here is a command to illustrate my problem Code: sudo rsync -a /home/youruser /tmp
If you try that and terminate with Ctrl-C after a few seconds, there will be a directory /tmp/youruser where the directories contained within are owned by root group root.
Don't ask me why, but I need to back up a website with complete structure to a windows machine (so no tar/gzip - just an identical copy). I'm experienced with rsync, so I thought to do it that way. However, in the process I'm bound to lose my ownership/permission settings for each file and that will give problems when placing back certain files. Is there a way to either:
1. save those settings on a windows machine? 2. have an easy way to save the filetree with relevant information and a shell script to attach the info back when uploading files again?
I wrote a script to wake up my windows machine and do an rsync backup of some of my files. I wanted to make this command a accessible through local bin so I made it executable. However the problem is that when I copies files is copies them with root permissions and i can edit or delete them. How can I set the files so they transfer with the proper permissions for my Ubuntu user?
Code: #!/bin/bash # Description: This script first wakes up the client machine and syncs the appropriate folders. # Finally the script shuts down the client if it was off to begin with. if [ "$(whoami)" != "root" ]; then echo "Permission Denied" exit 1 fi .....
We have a bunch of directories created for apps on server that were configured to a local group account (for ex: oracle). We have enabled AD using winbind after 6 months after these servers have been in use. So how can we tie the local oracle group account with the one in our AD tree.the test useris configured in the oracle group in AD and the test users primary group is oracle
I am using RHEL 5 on my server. The client machines are windows XP.File sharing is through samba server which is working okay. On this file server there is a shared directory for users. This directory contains files which are used by various users through oracle APP. and DB server.
At present the folders under the "shared" folder are having all permissions i.e. 777. To restrict certain things, I want that users may read and modify the files but may not be in a position to move or delete the files. How to set the permissions on the folders/files in this scenario?
I have a directory on the remote machine running redhat ES 2.1, which i want to copy to a local machine running fedora fc 10. I am using scp and want to retain permissions, links, and also ownerships of the copied directory structure. I am using scp -pr but the ownerships are all chaning to the user running scp, in my case its root. I have checked the user/groups. They are same on both the sides (lotus,bin,root). And yes I cannot use rsync as the remote m/c does not have this.
I'm planning to install openSUSE on a rather old computer(1,5 GB RAM 2,2 GHz Intel Celeron) and I have only 3,6 GB disk space at my disposal. Using Xfce or LXDE desktop environment what is the minimum installation size I can get while retaining a usable system?
I have about 50% of my music collection in wma format from my old Windoze days. I don't want to spend the time ( it is about 1800 songs) to re rip the tunes but I want uniform format. I tried using Sound Converter 1.4.4 but I lost all the meta-data.
Every time Ubuntu (10.04) starts, it uses a screen resolution of 1024x768. I change this successfully through Preferences to 1280x1024, but it is never remembered at the next boot. How do I ensure that it is. (I've read that an etc/X11/xorg.conf file may be used for this, but I don't have one and am unsure what I need to put into one)
I did not find any easy way to update firefox by googling so I am asking here. But Is there an easy way to update firefox to firefox 3.6 retaining all plugins, bookmarks etc. I am using fedora 12.
I presently have a Karmc LiveUSB with a casper-rw partition, but am thinking of changing the LiveUSB image to Maverick, while still using the existing casper-rw partition and its data (mostly settings for Ubuntu itself, haven't installed any programmes). Using usb-creator, by the way. Are the config files for Karmic and Maverick significantly different that this will cause any major problems? [Separately, I think this will have implications for my existing Karmic install, because I'm planning to clone my Karmic /home partition to a fresh Maverick install.
Thought I'd post it here because it's more server related than desktop... I have a script that does:
[Code]....
This is used to sync my local development snapshot with the live web server. There has to be a more compact way of doing this? Can I combine some of the rsyncs? Can I make the rsync set or keep the user and group affiliations? Can I exclude .* yet include .htaccess?
When I run rsync --recursive --times --perms --links --delete --exclude-from='Documents/exclude.txt' ./ /media/myusb/
where Documents/exclude.txt is
- /Downloads/ - /Desktop/books/
the files in those directories are still copied onto my USB.
And...
I used fetchmail to download all my gmail emails. When I run rsync -ar --exclude-from='/home/xtheunknown0/Documents/exclude.txt' ./ /media/myusb/ I get the first image at url.
I have a tiny shell script to rsync files between two servers and remove the source files.
This script works fine, when it has been initiated manually or even when the rsync command is executed on the command line.
But the same script doesn't work, when I try to automate it through crontab.
I am using 'abc' user to execute this rsync, instead of root, as root login to servers are restricted in all of our servers, by us.
As I mentioned earlier, manual execution works like charm!
When this rsync.sh is initiated through crontab, it runs the first command(chown abc.abc ...) perfectly without any issues. But the second line is not at all executed, and there is no log entry i can find at /mnt/xyz/folder/rsync.log.
Natty Narwhal with Catalyst Control Center for the ATI Radeon and FireGL graphics accelerators is installed.
Version-- 2:8.840-0ubuntu4 (fglrx-amdcccle)
Launching and configuring dual monitor support that connects and expands my Desktop/Workspace when my laptop is docked works fine. However, it does not want to retain the settings after a restart and I am forced to set it each time. Ideas?
I have ubuntu 8.04 installed on a full disk partition. I've just bought a linux magazine, which came with a CD containing Fedora 12. I want to dual boot or fully install while retaining my music, if at all possible.
I've tried running the Fedora disc and choosing to fill empty space with Fedora, but I get an error informing me that I don't have enough space. Presumably, this is because I have a full disk partition.
I'm using Ubuntu 10.04 LTS server and Postgresql 8.4. I have a .sh script that is run by cron every other hour. That works fine. The .sh script includes an rsync command that copies a postgresql dump .tar file to a remote archive location via ssh. That fails when run by cron; I think because it is (quietly) asking for the remote user's password (and not getting it). I set up the public/private ssh key arrangement. The script succeeds when run manually as the same user that the cron job uses, and does not ask for the password. I am able to ssh to the remote server from the source server (using the same username) and not get the password prompt (both directions), so why doesn't rsync work? I even put a .pgpass file in the root of that user's directory with that user's password, and the user/password are identical on both servers.
I think the problem is rsync is not able to use the ssh key correctly. I tried adding this to my script but it didn't help.
Code:
Here is the rsync command embedding in the .sh script.
is possible to edited the default RHEL CD to have it automatically install RHEL based off of a kickstart file that I will store locally on the CD. My plan would be to put a cd in a server and have the OS automatically being installed.