Is rsync --delete on some files without write permission possible?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Is rsync --delete on some files without write permission possible?
# 1  
Old 07-11-2013
Is rsync --delete on some files without write permission possible?

Hello all,

I have a problem with rsync command.
From a backup server, I use a command like the one below:
Code:
rsync -av --delete user@host:/home/user/  /home/backup_user/daily_rotating_backup/

In some folders of the user there are some files on which he has removed his write permission on purpose.
rsync complains about that:
Code:
rsync: open(bin/c_script/kohala/sock/RCS/strerror.c,v) failed!!: Permission denied (13)

Of course rsync as root on the user host would resolve the problem, but as I don't like to ssh as root user I was wondering if there would be another solution?

Many thanks for your help and kind regards,

PS: Oh, If you have any best practices reading reference on backup scripts I am very interested!
Thanks in advance!
freddie50
# 2  
Old 07-11-2013
Quote:
Originally Posted by freddie50
In some folders of the user there are some files on which he has removed his write permission on purpose.
This will not stop anyone from deleting them.

Removal of files inside the directory is controlled by write permission on the directory, not the file.
# 3  
Old 07-11-2013
Thanks for the remark Corona, this is very interesting and I had not realised that!
But back to rsync issue:
If I understand well, the problem from rsync point of view is that it cannot open the file without the write permission, but why on earth do you need write permission to compare 2 files, surely read should be enough?
And why does rsync need to open the file?
freddie50
# 4  
Old 07-12-2013
rsync does not need write permission to a file to copy it, it only needs read. I suspect you have a read permission problem.

If you are not executing the command as root, which user is executing the command?
It is safe to say not the owner of the file, since it would had copy it.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Assign read write permission to the user for specific dir and it's sub dir and files in AIX

I have searched this quite a long time but couldn't find the right method for me to use. I need to assign read write permission to the user for specific directories and it's sub directories and files. I do not want to use ACL. I do not want to assign user the same group of that directories too.... (0 Replies)
Discussion started by: blinkingdan
0 Replies

2. UNIX for Advanced & Expert Users

Rsync - delete extra files in Destination without synchronising directories

I have a script that synchronises a directory to a DR server, but to improve the time, I actually use rsync to transfer files * in one batch and also * in another batch - both batches run from the same script and run in the background. My problem is that there isn't much space on the... (1 Reply)
Discussion started by: Catullus
1 Replies

3. UNIX for Advanced & Expert Users

Rsync with --delete but do not delete peer dirs on target

rsync with --delete won't honor the delete if the source is something/*. I want the delete to work, but not to delete directories on the target that are peer to the intended directory. For example, using these source and target file structures: Source on desktop: ~/ Money/ ... (4 Replies)
Discussion started by: JavaMeister
4 Replies

4. UNIX for Advanced & Expert Users

Allow user without dir write permission to execute a script that creates files

In our project we have several unix scripts that trigger different processes. These scripts write logs to a particular folder 'sesslogs', create output data files in a separate directory called 'datafiles' etc. Usually L1 support team re-run these scripts . We donot want L1 support team to have... (14 Replies)
Discussion started by: waavman
14 Replies

5. UNIX for Dummies Questions & Answers

Rsync Can I delete .NFS and .fuse files

Hello, I have some files in a local directory and perform an rsync command with the files in a remote directory, Now when I checked the files in the local and the remote directory, I found some strange filetypes such as this: .nfs0000000001d0c8e000002ff2 , .fuse_hidden000014da00000001 etc etc,... (3 Replies)
Discussion started by: ajayram
3 Replies

6. Shell Programming and Scripting

search any user files with write permission

Guys, i wanna get any user files with write permission (on user or group permission) for review but i confuse with -perm parameter. any body can help me to explain what is that mean? thank's (1 Reply)
Discussion started by: michlix
1 Replies

7. Shell Programming and Scripting

rsync delete specific files - from different target folder

Hi, I need to use rsync to delete multiple files(only specified files not all) using --delete option, these files are located in different target folders. Instead of running rsync command multiple times for each file, can we achieve this with one time execution? your help is much... (0 Replies)
Discussion started by: MVEERA
0 Replies

8. UNIX for Dummies Questions & Answers

Not sure how to write a script to delete certain files?

I'm a total *nix newb so I really could use some help! :o I plan on running a cron job on my server that deletes some files and then backs up and emails the website for archival purposes. Before I get in too deep I'd like to remove some unnecessary files that phpThumb creates. I'm not sure... (4 Replies)
Discussion started by: Sinistral
4 Replies

9. Shell Programming and Scripting

Find all files with group read OR group write OR user write permission

I need to find all the files that have group Read or Write permission or files that have user write permission. This is what I have so far: find . -exec ls -l {} \; | awk '/-...rw..w./ {print $1 " " $3 " " $4 " " $9}' It shows me all files where group read = true, group write = true... (5 Replies)
Discussion started by: shunter63
5 Replies
Login or Register to Ask a Question