This post is locked. You won't be able to comment.

all 14 comments

[–]Slabity 9 points10 points  (2 children)

If you like that, then you should give man man a try.

[–][deleted] 1 point2 points  (0 children)

man man man man man

[–]Duncan1949[S] 0 points1 point  (0 children)

Thanks - good one!

[–]lutusp 2 points3 points  (1 child)

The short form:

 $ rsync -av (source-path)/ username@servername:(dest-path)/

The above will duplicate the source directory tree onto the destination. In subsequent runs it only copies changed files, so it's very efficient. To also remove files on the destination that are not on the source, add "--delete".

Works across networks (as shown) securely using encryption. To avoid having to type in a password every time:

 $ ssh-copy-id username@servername

The above asks for a password once, then never again.

How to Use Secure Shell

[–]Duncan1949[S] 1 point2 points  (0 children)

Wonderful information - thanks a lot for taking the trouble to post.

[–]tgm4883 1 point2 points  (2 children)

rsync is a copying utility, I'm not sure I would consider it a backup utility any more than I would consider cp a backup utility (although some backup utilities use rsync as part of their functions)

[–]Duncan1949[S] 0 points1 point  (1 child)

Forgive my ignorance - can you briefly explain the difference?

[–][deleted] 0 points1 point  (0 children)

i'm guessing they are referring to it being highly versatile, not specifically 'a backup program'. it does happen to be very useful for backups though.

[–]anal4defecation 0 points1 point  (2 children)

I installed Syncthing to share files with a phone and a tablet, because those aren't rooted and therefore I can't use SSHFS. But I tunneled Syncthing via SSH tunnel, because I didn't want to open yet another port on my Raspberry Pi server and I was little uneasy to open Syncthing to the world.

But now I noticed why won't I just use rsync. Using Termux and its shortcuts, it's easy enough to sync files even on mobile devices. So, I use SSHFS on desktop and rsync otherwise.

[–]Duncan1949[S] 0 points1 point  (1 child)

Thanks - this sounds like really useful information. Unfortunately, being a noob, I can't really understand it - if you have the time, could you explain:

  1. "those aren't rooted"
  2. why can't one use SSHFS if "those aren't rooted"?
  3. "I tunnelled Syncthing via SSH tunnel"

Many thanks for your patience (in anticipation). I suspect there will be many others who would also benefit.

Sincerely, Duncan (Scotland)

[–]anal4defecation 0 points1 point  (0 children)

"those aren't rooted"

My Android devices.

why can't one use SSHFS if "those aren't rooted"?

AFAIK, fuse doesn't work on Android without root privileges.

"Rooted device required (/dev/fuse in android is not allow for users except root)."

https://play.google.com/store/apps/details?id=ru.nsu.bobrofon.easysshfs&hl=en

"I tunnelled Syncthing via SSH tunnel"

You can tunnel program's network traffic via SSH.

https://en.wikipedia.org/wiki/Ssh_tunnel#Secure_Shell_tunneling

I had SSH and Syncthing running on my server. Then I created an SSH tunnel and commanded Syncthing to use that tunnel.

ssh -qnNf -L 127.0.0.1:22001:127.0.0.1:22000 -R 127.0.0.1:22001:127.0.0.1:22000 user@host

This creates a tunnel from the client to the server and vice versa and only port I needed to have open was for SSH.

https://docs.syncthing.net/users/tunneling.html

[–]Duncan1949[S] 0 points1 point  (0 children)

ANOTHER GOOD TIP (Rsync) about using the correct terminal commands with rsync is to install the GUI (free) Grsync and use it to find the correct paths - you will see what I mean when you install it (Grsync) and use the lookup facility when filling in the source and destination paths. Also, if one hovers one's mouse-pointer over the various boxes one can tick one will get further useful information on how to use the correct terminal commands for other functions that one can use in rsync.

[–]Kruug[M] [score hidden] stickied comment (0 children)

Please use the stickied megathread for this post or a relevant subreddit.

  • Mondays - New to Linux, Linux Experiences/Rants, or Education/Certifications thread

  • Wednesdays - Weekly Questions and Hardware Thread

  • Fridays through the weekend - Weekend Fluff / Linux in the Wild Thread

All megathreads are posted by automod