Skip to main content

Just learned about rsync

I just learned about the rsync command which is amazingly useful.
I have been using scp to copy folders from one machine at home to a machine in the lab back and forth and so far it's been good, and dead simple, but always involved extra work like making
moving directories around.

Now that I learned rsync, I can simply back up my work from the lab to my machine and vice versa using a simple command.
Here is the command I use:

rsync --delete -ravuzn -delete-excluded --exclude=*~ --rsh=ssh ~/work/ david@server.at.work.com:~/work/

and then, (notice I remove the n flag)

rsync --delete -ravuz -delete-excluded --exclude=*~ --rsh=ssh ~/work/ david@server.at.work.com:~/work/

so what does this command do:
flags:
--delete: if I have removed files from my local computer, they are also deleted on the server
r: recursively go through the folders and subfolders
a: archive
v: verbose mode
u: update
z: compress files
--delete-excluded: deletes excluded files passed as parameter (next flag)
--exclude=*~ : tells to exclude files ending with tilda (~)

there is also -b, which is for backup. It will create a file with ~, whenever we delete a file on the machine to which we are syncing. That might be useful if you don't want to delete some important work.
Also, there is flag n, which runs the rsync command as a dry run. This way, you can see what will happen when you run the same command without the n flag. This is the one I will always use first so that I am sure I know what will happen!

Thanks to this website:
http://mdolab.utias.utoronto.ca/resources/linux/file-synchronization-and-backup-with-rsync/

Comments

Popular posts from this blog

Chrome dev tools - secret weapon?

When I started working back in 2010, we used to support IE7. I still remember how much of a paint it was to debug javascript code. With IE8/IE9 debuggers, what I learned is patience, rather than figuring out how to fix all those weird bugs that *always show up *only in IE. The debuggers were so slow. Also back then, firebug was the norm. Chrome dev tools was relatively new and most people I knew did not use it. I liked Chrome so I sticked with it. Now, it's a tool that I use almost every day. In fact, I try to spend some time and follow what's new with the dev tools. I also spend some time experimenting with soon to be features/apis on Chrome Canary. This year, well last year... (2016), I've been pretty busy and haven't had much time to look at the new features. But today, I spent a few hours catching up on the last Google I/O and watch what's new with the dev tools. I wanted to share this link and give back some love to the chrome dev tools by writing this post.

converting videos with ffmpeg

I had to work on some video conversion and I found a good post from the Linux Journal on commands and tips for converting videos. http://www.linuxjournal.com/article/8517 A command example: ffmpeg -i eSeetrackFlash.flv -b 20000k -s 896x536 target_0.7.avi explanation to be continued