Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088
Rep:
File Sync between laptop and desktop
Hi,
I have a laptop running OS X 10.3, and a desktop running Debian Sarge. I need to synchronize files between the two, so that both the laptop and the desktop has the same copy of the files.
I guess I need to use rsync, but that copies new files but doesn't delete files on the other computer. For example, say I delete the file foo.txt on my laptop but not on my desktop. If I then rsync the laptop with the desktop, the file is copyed back to the laptop.
What I would like to do is have a shell script that I can run from the laptop, so that when I run it, I get the same copy of files on both the laptop and the desktop, regardless of which computer has the newest files.
You need to add the switch --delete-after to the line so that old files are deleted like;
rsync -ave ssh --delete-after /directory/ <laptop_ip-address or name>:/directory/
You can make a bash script with this and then to make it executable do chmod 700 ./<script_name>. It will still require you to interface to enter the password.
I use kde and run KBear to manage an Internet server and KBear has a facility to sync directories.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.