rsync is overwriting read-only files. How do I prevent this?

I'm using rsync -avlz to sync files between my development server and my production server. On my production server I have some config files with options specific to that server (e.g. passwords, port numbers, etc.) and I don't want those files overwritten when I do the rsync.

However, even though those files have 444 permissions, they are still being overwritten. Can anyone explain to me why this is happening or point me in the direction of how to prevent it? It seems to me that setting the files to read-only would prevent rsync from updating them.

NOTE: I'd prefer to not have to specifically exclude files if I don't have to. I'd love to have the server know not to allow overwriting of read-only files.

Answers


rsync does not care about "read-only", especially since you've told it to sync permissions as well. Keep local settings in a separate file and include them from the main configuration.


Need Your Help

Add Text To TinyMCE Visual Pane In WordPress

javascript wordpress tinymce tinymce-4

I have successfully written a TinyMCE plugin for a WordPress site that inserts a script tag into the html of a new post or page. However, since the script tag contains no text, in the "visual" pane

Detect keypress when Gtk.Entry is in focus

python gtk keypress gtk3

I was trying to make a Entry widget that clears it's content when Esc is pressed.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.