Skip to content
A docker image with the tools to backup all home folders to Google Cloud
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

FCloud Docker Backup to Google Cloud

To be able to backup home folders to Google Cloud.




Environment variables to set:

  • HOST_NAME: The hostname of the machine. Used in the path where the backup is saved.
  • BUCKET: The name of the bucket in Google Cloud.
  • JSON_KEY: The path to the file containing the Google Cloud key. (Default: /google-cloud-key.json)

Volume to mount:

  • /backupRoot: The directory with sub-directories to save in separate tgz files.

The tar files will be saved in gs://$BUCKET/$HOST_NAME/$NOW/$DIR.tar.gz

Usage Example

# Compile

# Create fake home directories
HOST_HOME_DIR=$(mktemp -d)
mkdir $HOST_HOME_DIR/user1
mkdir $HOST_HOME_DIR/user2
echo Testing > $HOST_HOME_DIR/user1/f1.txt
echo Testing > $HOST_HOME_DIR/user1/f2.txt
echo Testing > $HOST_HOME_DIR/user2/f3.txt

# Create the key
cat > $HOST_JSON_KEY << _EOF
  "type": "service_account",
  "project_id": "xxxxxx",
  "private_key_id": "xxxxxx",
  "private_key": "-----BEGIN PRIVATE KEY-----\nxxxxxx\n-----END PRIVATE KEY-----\n",
  "client_email": "",
  "client_id": "xxxxxx",
  "auth_uri": "",
  "token_uri": "",
  "auth_provider_x509_cert_url": "",
  "client_x509_cert_url": ""

# Execute 
docker run -ti --rm \
  --env HOST_NAME=$(hostname -f) \
  --env BUCKET=backup-bucket \
	--volume $HOST_JSON_KEY:/google-cloud-key.json \
	--volume $HOST_HOME_DIR:/backupRoot \

You can’t perform that action at this time.