AeroFS

Since some time I have been playing around with AeroFS(https://www.aerofs.com/) for a proper datasynchronisation between my devices.
I can’t say anything negative about it so far, it works fast, secure and is highly configurable for everyone.
To give an idea what AeroFS can do:

  • Private Syncing, allowed you to sync your devices between all your devices(Android & iOS support comming soon I hope!)
  • Unlimited Storage, the storage on your own devices is used and therefor your only limitation!
  • Sharing is caring, all your folders are private by default, but you can choose to share them with other AeroFS users
  • It’s Secure
    • Every device gets their own 2048bits key, making it very(!!) hard to be impersonated by black hat hackers!
    • These keys are used between your devices to verify their identity
    • These keys are also used to encrypt your data while syncing
  • It has a graphical interface for easy configuration, but also a shell client for advanced/scripted configuration

Best thing about this is, you dont have to rely on any public service, except for an Internet connection!
Although for me it is common sense I would like to have it noted that your devices have to be turned on at the same to have them synchronise!!

My Script

Because I like AeroFS a lot, it does what it promises to do and it shows to be stable already in the current Beta stage, I have started to reconfigure my (X)Ubuntu machines to use this as much as possible, so my data is always stored in my personal “cloud” and I dont have to worry whether I put that one file in my AeroFS folder or not. So basically all my devices work on my personal storage cloud.
Therefor I wrote a little bash script to run, that will make the important profile folders(Documents, Pictures, Music & Videos) get moved and linked to the AeroFS folders. That way if I ever save anything in these folders it’s automatically synced between my devices. I also made the script in a way it can easily be extended with more folders.
Below you will find the code, which you can just copy to a textfile and make it executable.(chmod +x [name textfile]) I will try to make this even more userfriendly or make a more extended description of how to do this as soon as possible.
You can configure some of the parameters yourself or just go with the default settings which work with a default (X)Ubuntu installation and a default AeroFS installation.

#! /bin/bash

# The location of the AeroFS shell binary
AEROFSBINSH="/usr/bin/aerofs-sh"
AEROFSOPTIONS="-e"
# The location of the AeroFS folder, default is set
AEROFSFOLDER=$HOME/AeroFS/
# Do you want this script to relocate your AeroFS Folder in case it isnt found at the configured path?
RELOCATEAEROFSFOLDER=0
# The folders to transfer/relocate to AeroFS, default folders with exception of Downloads
FOLDERS[1]="Documents"
FOLDERS[2]="Music"
FOLDERS[3]="Pictures"
FOLDERS[4]="Videos"
# Not transferred to AeroFS by default, uncomment to have them transferred as well
#FOLDERS[5]="Downloads"
#FOLDERS[6]="Desktop"
#FOLDERS[7]="Test"

# Migrate Data, do you want this script to transfer your data?(!!IT WILL BE DELETED IF NOT TRANSFERRED!!)
# (Yes = 1, No = 0)
MIGRATEDATA=1

MigrateFolder()
{
if [ -z "$1" ]                           # Is parameter #1 zero length?
then
echo "!!!No directory specified to migrate!!!"  # Or no parameter passed.
else
if [ ! -L $HOME/$1 ]; then
#
if [ -d $AEROFSFOLDER/$1 ]; then
echo "$AEROFSFOLDER$1 exists"
else
echo "Creating $AEROFSFOLDER$i"
$AEROFSBINSH $AEROFSOPTIONS mkdir $1
fi
if [ $MIGRATEDATA -eq 1 ];then
echo "Moving Data from $HOME/$i to $AEROFSFOLDER$1"
mv $HOME/$1/* $AEROFSFOLDER$1
fi
rm -rf $HOME/$1
ln -s $AEROFSFOLDER$i $1
else
echo "!!!$1 is Skipped since it was already a Symbolic Link in the homefolder!!!"
fi
fi
}
MigrateAeroFS()
{
for i in "${FOLDERS[@]}"; do
MigrateFolder $i
done
}

read -p "Press [Enter] key to start AeroFS Configuration..."
cd $HOME
if [ -e "$AEROFSBINSH" ]; then
echo "Pausing AeroFS"
$AEROFSBINSH $AEROFSOPTIONS pause
#    echo "AeroFS is installed"
#    echo "$AEROFSFOLDER"
if [ -d $AEROFSFOLDER ]; then
#        echo "AeroFS Folder does exist"
MigrateAeroFS
else
#        echo "AeroFS Folder does NOT exist"
if [ $RELOCATEAEROFSFOLDER -eq 1 ]; then
echo "Relocating AeroFS Folder"
mkdir -p $AEROFSFOLDER
$AEROFSBINSH $AEROFSOPTIONS relocate $AEROFSFOLDER
MigrateAeroFS
else
echo "!!!Your AeroFS Folder isnt properly configured in this script and isnt allowed to be relocated!!!"
fi
fi
echo "Resuming AeroFS"
$AEROFSBINSH $AEROFSOPTIONS resume
else
echo "!!!AeroFS is NOT installed or binarypath is not properly configured in this script!!!"
fi

Little disclaimer, using this script is entirely at your own risk. Although I have tried to built in some checks to see whether everything is alright, I take no responsibility for any damage this script could cause.

Share on Facebook
Share on LinkedIn
Share on StumbleUpon
Share on reddit