Special Holiday Offers HostUS, 2GB RAM VPS cost only $ 25 / year

Coupon VPS from Host Us

Welcome the year-end holidays, HostUS taken various promotions including 2 OpenVZ VPS package super cheap prices KVM VPS and VPS STORAGE.

Parameter 2 VPS promotional package this session as follows:

OpenVZ VPS

KVM VPS STORAGE

$ 25/per year

  • 256MB of RAM
  • 180GB Disk Space (RAID 10)
  • 1 vCPU Core
  • 1TB Bandwidth
  • 1Gbps Port (Fair Share)
  • 1 IPv4 & IPv6 4
  • Location: US
  • Annual Price: $ 25
  • Quarterly Price: $ 8

Package VPS 2GB This is too good for dich vu seo web, the price is only $ 25 when paid in years, counted out just $ 2.08 / month only. Also pack KVM VPS STORAGE RAM at 256MB web server should not do, however, high-capacity 180GB Disk Space (RAID 10) can do server storage, backup.

In addition, this phase HostUS discount coupon also launched a range of services on site, press the corresponding button to copy code:

8ATPBD47L2 – Shared Hosting 30% discount when paying by year
SDSFI4V78Y – 20% discount Reseller Hosting
M2YSVHK9W2 – 25% Off & KVM VPS OpenVZ packages
GN47EO8JD6 – Comodo PositiveSSL cost only $ 4.99 / year

Deals stretching from now until 01/03/2017 or end slot when registering. The entire coupon, promotion is only for new subscribers only.

If you need to register Hong Kong or Singapore location, refer to article.

Special Holiday Offers HostUS, 2GB RAM VPS cost only $ 25 / year
5 (100%) 10 vote

[HocVPS Script Plugin] – Automatically backup the entire VPS

Yesterday I had to share a script to help automatically backup the entire WordPress website activity on the server settings HocVPS Script . However, today I will introduce a better bash scripts, the entire VPS backup with instructions to create autorun daily cronjob always.

This script automatically back up all data on the server, including:

  1. The entire MySQL database, each database .sql file
  2. The entire code in the folder public_html of the domain, in the form /home/domain.com/public_html/
  3. Complete Nginx configuration folder /etc/nginx/conf.d/

All data will be compressed into a .zip file to the directory and / root / backup / and automatically delete old backup files, only keeping the file within 14 days of return.

Thus, you absolutely can use this script to move the VPS, or restore any particular piece of data. Her script writing is compatible with the directory structure by HocVPS Script management, but you can also modify to fit any other server also.

Currently, I am using this script to daily data backup and upload to Google Drive with Rclone.

Guidelines automatically backup the entire VPS

1. Create a backup script bash

– Creates backup.sh file in the directory / root /

 nano /root/backup.sh

Consult guidelines use nano if unknown user.

– Copy the entire contents of the script below and paste into:

 # HocVPS Plugin Script - Backup Server

#! / Bin / bash

. /etc/hocvps/scripts.conf

SERVER_NAME = VPS

TIMESTAMP = $ (date + "% Y-% m-% H% M D_%")
BACKUP_DIR = "/ root / backup / $ TIMESTAMP"
MYSQL_USER = "root"
MYSQL = / usr / bin / mysql
MYSQL_PASSWORD = $ mariadbpass
Mysqldump = / usr / bin / mysqldump
SECONDS = 0

mkdir -p "$ BACKUP_DIR / mysql"

echo "Starting Backup Database";
= `$ MYSQL databases --user = $ MYSQL_USER -p -e $ MYSQL_PASSWORD" SHOW databases; " | -Ev grep "(Database | information_schema | performance_schema | mysql)" `

print for $ db databases; dirty
$ Mysqldump --user = $ MYSQL_USER --opt --force -p $ MYSQL_PASSWORD --databases $ db | gzip> "$ BACKUP_DIR / mysql / $ db.gz"
done
echo "Finished";
echo '';

echo "Starting Backup Website";
#Loop Through the / home directory
for D in / home / *; dirty
if [ -d "$D" ]; then #if a directory
domain = $ D ## * / # Domain name
echo "-" $ domain;
zip -r $ BACKUP_DIR / $ domain.zip / home / $ domain / public_html / q -x / home / $ domain / public_html / wp-content / cache / **  * #Exclude cache
fi
done
echo "Finished";
echo '';

echo "Starting Backup Nginx Configuration";
cp -r $ /etc/nginx/conf.d/ BACKUP_DIR / nginx /
echo "Finished";
echo '';

echo "Starting Compress Files";
zip -r -q /root/backup/$SERVER_NAME-$TIMESTAMP.zip $ BACKUP_DIR
rm -rf $ BACKUP_DIR
size = $ (ls -lah /root/backup/$SERVER_NAME-$TIMESTAMP.zip | awk 'print $ 5')
echo "Finished";
echo '';

#remove Older backups (14 days)
find / root / backup / -mindepth 1 -mtime +14 -delete

duration = $ SECONDS
echo "Total $ size, $ (($ duration / 60)) minutes and $ (($ duration% 60)) seconds elapsed."

Additional explanation:

  • Name the backup file is automatically set to the current date and time.
  • MYSQL_USER default is root, password is taken in the configuration file /etc/hocvps/scripts.conf.

– Press Ctrl + O, Enter to save and Ctrl + X to exit.

– Distribution rights to the script

 chmod + x /root/backup.sh

– So that’s it then, now you can test it by running the command /root/backup.sh

Done, check the folder / root / backup / has yet lightweight .ZIP file backup.

2. Create automated daily backup cronjob

Now I would for scripts automatically run at 2:00 am.

 crontab -e EDITOR = nano

Paste the following into the Terminal window

 0 2 * * * /root/backup.sh> / dev / null 2> & 1

Press Ctrl + O, Enter to save and Ctrl + X to exit

That’s it, keep daily 2am script automatically runs, the entire data backup of VPS.

In the next article, I will guide you how to automatically upload files to Google Drive backups to save space for VPS. Me welcome to read offline.

[HocVPS Script Plugin] – Automatically backup the entire VPS
5 (100%) 10 vote