Server :: Rsync To Windows / File Permissions & Owners?
Feb 7, 2010
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?
Every time I update certain packages with rpm/yum, they reset certain permissions on their files / directories which I have intentionally changed for various reasons. Is there a way I can override the permissions that the packagers have specified in the RPMs, and force it to keep the permissions/owner/group that I've set?On a Debian system, I would just use "dpkg-statoverride". I can't find any equivalent for RPM systems (CentOS 4 & 5 in my case).
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.
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?)
as the title, I have to create a file, example: /home/john/file.ini I created an user and a group, myuser:mygroup and set them to this file.ini chown myuser:mygroup file.ini Ok, my problem is I have another user named mymain this user must read this file, so how can I change the permissions? IMPORTANT: I ONLY have to allow "mymain" user to read this file, NOT all other users
I have tried chown and pcman in root mode but I can not change the owner or group of the directories and files on this drive. I think my inability to open both firefox and thunderbird are connected to this problem. Both profiles are on the rade drive. There are no .parentlock files in the profiles and yet the report is that both programs are in use, even after restarting the computer. I have had to install cromium to go online in lieu of FF:
this is my fstab. this is the line refers to the rade ntfs drive:
# /media/mydocs was on /dev/sdc1 during installation UUID=724E07853D78E7A8 /media/mydocs ntfs defaults,umask=0022,gid=46 0 0 Quote: # /etc/fstab: static file system information. # # Use 'blkid -o value -s UUID' to print the universally unique identifier
iam trying to sync file server data into backup server machine by command- rsync -avu path/of/data ipaddress-of-backup-server:/path/where/to/save after running it ask for root password and manually it is successful.but i want to make it automatic.for that i also tried cronjob and also generated authentication key but iam not successful in login automatically..anybody know how to authenticate root to login for storing data in backup server.
I'm trying to rsync files and directories from a RedHat linux host(v 4.5 & 4.7) to a Windows server 2003R2 Standard Edition with cygwin running. I'm executing the rsync command from the cygwin shell. The transfer involves rsync'ing approximately 1 TB of data from the linux server to the windows server. After about 280+GB of data transfer, the transfer just dies.
There seems to be no particular file or directory that the transfer stops at. I'm able to rsync GB's of data from other linux hosts to this cygwin server with no problem. Files and directories rsync fine.The network infrastructure is essentially the same regardless of the server being rsync'ed in that it is GB Ethernet running through Cisco GB switches. There appear to be no glitches or hiccups across the network path.
I've asked the folks at rsync.samba.org if they know of any problems or issues. Their response has been neutral in that if the version of rsync that cygwin has ported is within standards then there is no rsync reason this problem should happen.I've asked the cygwin support site if they know of any issues and they have yet to reply. So, my question is whether the version of rsync that is ported to cygwin is standard. If so, is there any reason cygwin & rsync keep failing like this?
I've asked the local rsync on linux guru's and they can't see any reason this should fail from a linux perspective. Apparently I am our company cygwin knowledge base by default.
We're in the process of implementing an offsite backup of all our servers to a remote Linux server. We're using rsync over ssh.What I've found is that characters such as ±, ¶,´ and £ are replaced on the Linux server with underscores.I don't mind if it changes these characters in the filenames of documents, but when it renames a language pack from Espa±ol.clx to Espa_ol.clx, it could cause issues for us further down the line.
What do I need to do differently to make the special characters copy over correctly? For the initial sync which will take place locally, before the machine is moved offsite, I have SAMBA enabled. I am able to copy files from Windows to the Samba share, retaining the original filename, though it looks different in the Linux directory listing, i.e. tÃªst becomes ªstThese files get deleted by rsync when it runs, as it does not match the filenames.
i have an ubuntu server 4 windows client..i use putty or webmin. would like to copy some folders for example: "My houses"to be backup everynigth to the ubuntu server..can somebody give me an easy way for doing this with rsync and smb or cifs.
when i use rsync command to backup my image file , it shows the following error message.
bash: line 1: /usr/bin/rsync: Argument list too long rsync: connection unexpectedly closed (0 bytes received so far) [receiver] rsync error: remote command could not be run (code 126) at io.c(463) [receiver=2.6.8]
The command which i used is rsync -avrl -e ssh cms@server:/data/cms/data/images/* /mnt/Backup/Intranet_cms_backup/images
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.
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'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 am currently using the windows version of gVim to edit source files on a networked drive mapped to a linux system, as well as local files created in cygwin.
The problem is that the windows version of gVim destroys the original file permissions on the respective systems. IE: Files on cygwin are defaulted to 077. When edited by the windows version of vim they are saved as 777.This problem doesn't even occur when using ms-notepad (as well as all other editors I've tried), so I am not quite sure why gVim does it.
A possible solution would be to use cygwin's gVim for everything, but that's rather cumbersome as it requires running an x11 environment to support it, and it causes some problems when running some commands from within gVim (or vim for that matter) when working on the networked drive.
Any ideas how I might be able to maintain the existing file permissions?
This morning while on a different machine the problem with cygwin did not occur. Cygwin & gVim were the same version, however the other machine is running WinXP while the machine the problem is occurring on runs Win7.
I have a remote directory shared over NFS called tech with perms set as 0750 and owner set to root:tech. I have 2 groups: tech, and techAdmin. tech can read and execute within tech/. techAdmin can read, write, execute. I have 4 users: user1, user2, user3, user4. user1 and user2 is a member of techAdmin, user3 and user4 are members of tech. simple so far...but wait here's the problem. If user1 creates a file inside tech, user2 cant read or modify it because user1 owns it. Here's a few sites that reference this problem:
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.
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.
Here is the rsync command embedding in the .sh script.
When viewed using Ubuntu 8.4 files and dates on a Windows partition appear normal both in file manager and terminal. However booting using Knoppix CD these files are all green, and I cannot change their permissions, even as root. ie: everything is green including text files etc. If I copy them to a linux partition, I can change their permissions and make them nonexecutable and nonwritable. Also on the Windows FAT32 partition the . directory has the date 1 Jan 1970.
If I disable any green files, I can shutdown and reboot cleanly. If I don't I start having problems shutting down [/usr/sbin/init ?] And always these follow a pattern:
Can't remember details as I have now corralled the beast but error messages relating to:
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 .....