How to use HubiC storage for server backups

  • Upgrade Your Account
    Hello Guest ! Upgrade your account to download any of our premium products Here.
    How to upgrade your account to download resources Learn More.
    Guest need to read through our rules and regulations Learn More.
    Important! Read your welcome message To know how to download.

treki

Member
Nov 3, 2019
4
0
1
HubiC is not only slow, but also the WebGui is very bad and has no FTP or Webdav.
However, cheap (9 € / year for 100GB).
Wondered what I could do with it.

My idea: I use it as a backup storage

First I install p7zip-full .
Then rclone:
To install rclone on Linux/macOS/BSD systems, run:
curl https://rclone.org/install.sh | sudo bash

For beta installation, run:
curl https://rclone.org/install.sh | sudo bash -s beta

rclone config
see: https://rclone.org/hubic/

get new token (for servers without GUI):
see: https://rclone.org/remote_setup/
do this locally on a Linux PC. The token is then in /home/USER/.config/rclone

Script backup.sh (rights 700):

Code:
#!/bin/bash
DATE=$(date +%d.%m.%Y-%H.%M)
cd /home/backup/
mysqldump -u backupuser -p'DBpasswort' --all-databases > /home/backup/forum-"$DATE".sql

7z a -t7z -mx=9 -p12345 forum-"$DATE".7z forum-"$DATE".sql
rm forum-"$DATE".sql

cd /var/www/vhosts/domain/httpdocs
tar -cf /home/backup/httpdocs-"$DATE".tar *

cd /home/backup
7z a -t7z -mx=9 -p12345 httpdocs-"$DATE".7z httpdocs-"$DATE".tar
rm httpdocs-"$DATE".tar
rclone copy /home/backup hubic:hubic_backup_name

if [ $? -ne 0 ]
then
    echo "Backup fehlgeschlagen: "$DATE | mail -s "Backup -failed" [email protected]
    exit 1
fi
echo "Backup ok: "$DATE | mail -s "Backup" [email protected]


rm httpdocs-"$DATE".7z
rm forum-"$DATE".7z

rclone --min-age 30d delete hubic:hubic_backup_name
exit

I use an EHCP force. That is why my forum root is in the httpdocs directory.
Whereby e-mail, DBpasswort and 12345 have to be adjusted.

Finally the crontab (create as root!)

Code:
0 2 * * * /home/backup.sh >/dev/null 2>&1
 

treki

Member
Nov 3, 2019
4
0
1
  • Script into /home directory
  • Create a directory /home/backup
  • The backup files are password (here 12345) protected (with AES256 from 7zip)