DEV Community

Cover image for A tale of rsync
Ahmed Khaled
Ahmed Khaled

Posted on

3 1

A tale of rsync

I was migrating /var directory on some on-premises server I was working on from a low space disk to a larger one and I had to use the infamous rsync for this. I found the necessary parameters to on this article but I didn't like the idea of copying & pasting blindly without knowing what each parameters do. So I just looked the man page of rsync and decided to document what I found here for future references.

The full command I used:

rsync -aqx /var/* /mnt/newvar
Enter fullscreen mode Exit fullscreen mode

Here's a table with each flag explained:

Flag Usage
-a Shorthand for -rlptgoD
-r Recursive
-l Copy symlinks as symlinks
-p Preserve permissions
-t Preserve modification time
-g Preserve group
-o Preserve user
-D Preserve devices files & special files
-x Don't cross filesystem boundaries ()
-q Make it quiet

The -x flag means don't copy other filesystem files and directories like NFS, Samba, ..etc. 1

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay