Post4VPS Forum | Free VPS Provider
GBackup, by HMR (need help) - Printable Version

+- Post4VPS Forum | Free VPS Provider (https://post4vps.com)
+-- Forum: VPS Discussion (https://post4vps.com/Forum-VPS-Discussion)
+--- Forum: VPS Support (https://post4vps.com/Forum-VPS-Support)
+--- Thread: GBackup, by HMR (need help) (/Thread-GBackup-by-HMR-need-help)

Pages: 1 2


GBackup, by HMR (need help) - youssefbasha - 04-10-2018

Hello, 
I want to backup my vps so i installed HMR GBackup from their github. 
And i pressed run
Then i got this
Ofc i won't paste the introduction of the GBackup and etc. 
...¤...¤...¤...¤.........¤...¤...¤...¤...¤...¤...¤...¤...¤...¤
Files & MySQL Backup Folder not found
Creating Folder: Files & MySQL Backup

No valid arguments given, use 'gdrive help' to see available commands
Backuping the DATABASES
-----------------------
-> Dumping database: mysql:[Warning]Usingapasswordonthecommandlineinterfacecanbeinsecure.
-> Dumping database: ERROR2002(HY000):Can'tconnecttolocalMySQLserverthroughsocket'/var/run/mysqld/mysqld.sock'(2)
backup_gdrive.sh: line 171: /tmp/Server_Backup/mysql/ERROR2002(HY000):Can'tconnecttolocalMySQLserverthroughsocket'/var/run/mysqld/mysqld.sock'(2).sql: No such file or directory
-----------------------


Compressing all files for Upload.....
tar: Removing leading `/' from member names
tar: /var/www/vhosts/system/forum.mw5-samp.com/php-fpm.sock: socket ignored
tar: Removing leading `/' from hard link targets
tar: /var/www/vhosts/system/tbs-clan.cf/php-fpm.sock: socket ignored
tar: /var/www/vhosts/system/firex-host.com/php-fpm.sock: socket ignored
tar: /var/www/vhosts/system/eslamelshabrawy.com/php-fpm.sock: socket ignored
tar: /var/www/vhosts/system/media.firex-host.com/php-fpm.sock: socket ignored
tar: /var/www/vhosts/system/bin.amir.ovh/php-fpm.sock: socket ignored
tar: /var/www/vhosts/system/workedia.tk/php-fpm.sock: socket ignored
tar: /var/www/vhosts/system/mw5-samp.com/php-fpm.sock: socket ignored
tar: /var/www/vhosts/system/youssefbasha-dev.tk/php-fpm.sock: socket ignored
tar: /var/www/vhosts/system/samp-pw.ga/php-fpm.sock: socket ignored


-----------------------
Uploading Gbackup_10-04-2018.tar.gz at Google Drive...
Failed to get file: googleapi: Error 404: File not found: -delete., notFound
-----------------------

Clearing Junk files...
-> Removing /tmp/Server_Backup
Done!
...¤...¤...¤...¤...¤...¤...¤...¤...¤`¤...¤...¤`¤`¤
Not it gave me fail, i tried again and the same error. 
Also it ignored every file i want to backup..


RE: GBackup, by HMR (need help) - tiwil - 04-11-2018

Basically, I've the same error. And right now I used more shorter script (without checking anything with if...else statement).

Back to topic, have you tried with sudo? What kind of OS you're running right now?


RE: GBackup, by HMR (need help) - youssefbasha - 04-11-2018

Ubuntu 16.04, but i lost everything at my vps and now i want to backup domain files before resetting the vps.


RE: GBackup, by HMR (need help) - perry - 04-11-2018

this script is built for centos.
it's not built for any other os.

as I have heard from @Dynamo.


RE: GBackup, by HMR (need help) - youssefbasha - 04-11-2018

Ugh, then who can help me to backup my files?
@Dynamo? @perryoo11


RE: GBackup, by HMR (need help) - perry - 04-11-2018

@youssefbasha,

you might want to open up your discord as I have responded to your request.


RE: GBackup, by HMR (need help) - tiwil - 04-11-2018

Is the problem solved or not? I've my own backup script. I will give you if you need that.


RE: GBackup, by HMR (need help) - youssefbasha - 04-11-2018

(04-11-2018, 01:43 PM)tiwil Wrote: Is the problem solved or not? I've my own backup script. I will give you if you need that.

Yes please give me it. Problem not solved..
Thanks for your helping me.


RE: GBackup, by HMR (need help) - tiwil - 04-11-2018

Ok, so, this is my backup code, you need to install drive first as following:
Code:
cd /usr/bin
wget -O drive https://drive.google.com/uc?id=0B3X9GlR6EmbnMHBMVWtKaEZXdDg
chmod 755 drive
drive

After using command "drive", you will be given a link from google. Open it, then login with your google account, you will get a "token" or verification code. Copy and paste it to the command line.
Example as following:
Quote:abc@xyz:/usr/bin]# drive
Go to the following link in your browser:
https://accounts.google.com/o/oauth2/auth?client_id=367116221053-7n0vf5akeru7on6o2fjinrecpdoe99eg.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=state

Enter verification code:

Ok, then you can use the following backup script.
Code:
#!/bin/sh
# file name as date
date=$(date +"%Y-%m-%d")

# backup folder
backupfolder="/home/YOUR USERNAME/backups"
backuptarget="/home /etc /var/www /usr/local" # folder to backup

# database
dbhost="localhost"
dbuser="YOUR DB USER"
dbpassword="YOUR DB PASSWORD"

# make directory if not exists
mkdir -p $backupfolder
mkdir -p $backupfolder/mysql
echo "Starting backup"

# backup database, thanks to HMR
databases=$(mysql --host="$dbhost" --user="$dbuser" --password="$dbpassword" -e "SHOW DATABASES;" 2>&1 | grep -v "Warning: Using a password" | tr -d "| " | grep -v Database)
for db in $databases; do
    if [ "$db" != "information_schema" ] && [ "$db" != "performance_schema" ] && [ "$db" != "mysql" ] && [ "$db" != _* ] ; then
        mysqldump --compress --host="$dbhost" --user="$dbuser" --password="$dbpassword" --events $db > $backupfolder/mysql/$db.sql 2>&1 | grep -v "Warning: Using a password"
    fi
done

# compressing file
tar -cf $backupfolder/$date.tar.gz $backuptarget
echo "Backup done named $date.tar.gz"
echo "Starting upload to Google Drive"
# uploading file
drive upload --file $backupfolder/$date.tar.gz
echo "Done, removing local backup files"
# removing file
rm $backupfolder/$date.tar.gz
echo "Job done"

Let me know if you're facing any errors (which shouldn't happened, already test it with my VPS.)


RE: GBackup, by HMR (need help) - youssefbasha - 04-11-2018

Where to add this backup script? (name)
I installed everything but now waiting to select the db backup and etc so i want to edit it.