Raspi

Raspberry Pi | BASH | Tips & Trick

This is the most minimalist guide to copying files with rsync. And quite frankly it's not as concise. However if you know the basic of linux (mainly debian systems) you will feel right at home.

NOTE: These commands and variables are in assumption that you're only trying to sync your base home directory from the server to your local machine and vice versa.

Env variables

sourcehere = /home/$USER/ destination = /home/$USER/ serveraddr = user@123.456.7.8:/home/$USER/


How I sync...

locally rsync —update -vhraz —progress —ignore-existing —human-readable $source_here $destination

globaly rsync —update -vhraz —progress —ignore-existing —human-readable -e “ssh -c aes128-ctr” $server_addr $destination

aes128-ctr is great for downloading large files from distant servers; especially when downloading to your raspberry pi.

Here's a copy of the aliases

alias synchome='sshfs -o ciphers=aes128-ctr,compression=no,autocache,reconnect,kernelcache,allowroot $server_addr $destination'

alias syncserver='sshfs -o ciphers=aes128-ctr,compression=no,autocache,reconnect,kernelcache,allowroot $server_addr $destination'

Make sure you edit $serveraddr_ & $destination to your preference and add the appropriate folder

Now when you type: sync_home the remote server will sync with your local machine. It's that easy.



Till next time....!