Your Webhosting Questions
Answered by the Webhosting Experts
Tags
...
...

Cloud Storage: FTP / SFTP How to

*Update 10/2021: Please note, this is an EOL product no longer being offered to new customers.

FTP (port 21) and SFTP (port 22) are supported, using your login and password in the Cloud Storage panel.

 

Example Backup Script:

This script will sync backups from a directory on your server. You will need rsync, mutt, and curl.

# You must have mutt installed for email alerts and curl installed to upload the files to the ftp server.
# Change settings to match your settings!
# !/bin/bash

# Date for files
DATE=`date +%A_%b_%d_%Y`

# Home Directory
HOMEDIR=/backup

# FTP Username
USERNAME=username

# FTP Password
FTPPASSWORD=password

# FTP Hostname or IP Address
HOSTNAME=127.0.0.1

# Server Name
SERVERNAME=server1

# Send Confirmation email to this address
[email protected]

# Uptime
UPTIME=`uptime`

#Make Directory
mkdir /backup/$DATE >> /backup/$DATE.log

# MySQL
DBUSER=database user
DBPSWD=database password
DATABASE1=database

# Touch Log file
echo "-+-+-+-+-" >> $HOMEDIR/$DATE.log
echo $DATE >> $HOMEDIR/$DATE.log
echo "-+-+-+-+-" >> $HOMEDIR/$DATE.log
echo $UPTIME >> $HOMEDIR/$DATE.log

# Backup Databases
mysqldump -u $DBUSER -p$DBPSWD $DATABASE1 > $HOMEDIR/$DATE/$DATABASE1.sql >> $HOMEDIR/$DATE.log

# rsync Meta partition to $BACKDIR/$DATE/
rsync -a -v /var/www/ /backup/$DATE/www/ >> /backup/$DATE.log

# TAR UP FILES
tar -czf $HOMEDIR/$SERVERNAME$DATE.tar.gz /backup/$DATE >> /backup/$DATE.log

# Send backup files to redundant back up server
curl -T $HOMEDIR/$SERVERNAME$DATE.tar.gz ftp://$USERNAME:$FTPPASSWORD@$HOSTNAME:21/$SERVERNAME$DATE.tar.gz >> $HOMEDIR/$DATE.log


#Mail user when complete
mutt -s "Back up complete $UPTIME" -c $EMAILADDRESS1 -i $HOMEDIR/$DATE.log >> $HOMEDIR/$DATE.log

Need More Personalized Help?

If you have any further issues, questions, or would like some assistance checking on this or anything else, please reach out to us from your my.hivelocity.net account and provide your server credentials within the encrypted field for the best possible security and support.

If you are unable to reach your my.hivelocity.net account or if you are on the go, please reach out from your valid my.hivelocity.net account email to us here at: [email protected]. We are also available to you through our phone and live chat system 24/7/365.

Tags +
...