Rsync examples

sleep 5
rsync -avxzzhSP –stats –delete –rsh=ssh /mnt/owncloud-data root@truenas.domain.tld:/mnt/tank0/backup/

sleep 5
ssh root@truenas.domain.tld chown -R user:user /mnt/tank0/backup/

sleep 5
rsync -avxzhSP –stats –delete –rsh=ssh /mnt/owncloud-data root@linux-server.domain.tld:/mnt/backup/

#Google Drive
# Prereqs see
sleep 5
rsync -avxzh –progress –stats –inplace –delete /mnt/owncloud-data/ /mnt/google-drive/

Mount Google Drive locally to a Linux machine

Install everything to mount the Google Drive to a local folder in Linux
sudo add-apt-repository ppa:alessandro-strada/ppa
sudo apt-get update
sudo apt-get install google-drive-ocamlfuse

Configure Google Drive API and OAuth consent screen headless

Sign in to your Google account and create a project:

Enable the Google Drive API
In the left-hand pane (Navigation menu), open „APIs & Services“ -> „Library“, this will take you to
Click on „Google Drive API“, this will open . Click „ENABLE API“.

Get your client ID and client secret
Open the Navigation menu (click the hamburger icon at the top left), open „APIs & Services“ -> „Credentials“, this will open
Then click on the button „Create Credentials“, and choose choose „OAuth client ID“, this will take you to .
For Application type, choose „Other“ or „Desktop“
For Name, input something personal, for example „My OCAMLDrive“.
Click „Create“. You will get a Client ID, a Client Secret.

If you have no Workspace and just a personal Google account please add the accounts mail address to testusers of the OAuth Consent Screen

Issue command
google-drive-ocamlfuse -headless -id -secret YTFUBKJN-quikdgsdnJ_BSfa8dsfjgJSBGdkj

Please, open the following URL in a web browser:

Please enter the verification code:
Access token retrieved correctly.

If you have trouble accessing it after a few days and also remounting leads into io-error notification please delete ~/.gdfuse director and redo the above auth steps.

Create a image file, encrypt via LUKS and mount it and rsync to it from remote Linux

On remote side
sudo -i
dd if=/dev/zero of=/root/file-luks.container bs=4M count=25000 status=progress
mkdir -p /mnt/file-luks.mountpoint
apt install cryptsetup
modprobe dm-crypt
cryptsetup -y luksFormat ~/file-luks.container
cryptsetup open /root/file-luks.container file-luks
mkfs -t ext4 /dev/mapper/file-luks
mount /dev/mapper/file-luks /mnt/file-luks.mountpoint

On local side
cd source
rsync -avxzhSP –delete –rsh=ssh ./* root@remote-host.tld:/mnt/owncloud-luks.mountpoin