Find the answer to your Linux question:
Page 3 of 4 FirstFirst 1 2 3 4 LastLast
Results 21 to 30 of 40
Originally Posted by mizzle Here's a link to a script I wrote and use for backups of my site. Just uncomment/copy the lines for however many DBs you have. Includes ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #21
    Just Joined!
    Join Date
    Aug 2012
    Posts
    54

    Quote Originally Posted by mizzle View Post
    Here's a link to a script I wrote and use for backups of my site. Just uncomment/copy the lines for however many DBs you have. Includes compression and encryption.
    Backup MySQL database
    Not sure if your hosting provider's server includes the command mutt, but it's required for the automated email feature of the script. Probably will want to comment that out if they don't have mutt.
    There is a problem.

    Below is the code I run

    Code:
    #!/bin/bash
    dbName1="db2325324_arcade"
    dbName2="db2325324_gamificationprogramguide"
    dbName3="db2325324_gsc"
    dbName4="db2325324_referralproguk"
    dbName5="db2325324_referrralprogramguide"
    dbName6="db2325324_replica"
    dbName7="db2325324_selfservice"
    dbName8="db2325324_socialpromotionsguide"
    dbName9="db2325324_wordpress"
    dbName10="db2325324_affiliatemarketingprogramguide"
    dbName11="db2325324_affiliatepartnershipguide"
    dbName12="db2325324_affiliateprogramjournal"
    dbName13="db2325324_affiliatesolutionguide"
    dbName14="db2325324_brandadvocacycentral"
    dbName15="db2325324_brandadvocacyguide"
    dbName16="db2325324_selfservice"
    dbName17="db2325324_churnratereductionguide"
    dbName18="db2325324_customeradvocacycentral"
    dbName19="db2325324_customeradvocacyguide"
    dbName20="db2325324_customerloyaltycentral"
    dbName21="db2325324_franchisemarketingcentral"
    dbName22="db2325324_franchisesuccessguide"
    dbName23="db2325324_gamificationcentral"
    dbName24="db2325324_localpromotionsguide"
    dbName25="db2325324_loyaltyjournal"
    dbName26="db2325324_loyaltymanagerguide"
    dbName27="db2325324_loyaltyprogramguide"
    dbName28="db2325324_loyaltyprogramvendors"
    dbName29="db2325324_membershipretentionideas"
    dbName30="db2325324_onlineaffiliateprogramguide"
    dbName31="db2325324_opengraphintegrationguide"
    dbName32="db2325324_partnershipmanagerguide"
    dbName33="db2325324_partnershipprogramguide"
    dbName34="db2325324_promotionpartnerscentral"
    dbName35="db2325324_promotionpartnersguide"
    dbName36="db2325324_referraljournal"
    dbName37="db2325324_retailbrandguide"
    dbName38="db2325324_retailfranchisecentral"
    dbName39="db2325324_retentionguide"
    dbName40="db2325324_saasretentionguide"
    dbName41="db2325324_socialadvocacyguide"
    dbName42="db2325324_socialgraphpromotionsguide"
    dbName43="db2325324_socialloyaltyguide"
    dbName44="db2325324_socialreferralcentral"
    dbName45="db2325324_upsellguide"
    dbName46="db2325324_upsellingtechniques"
    
    fileName1=$dbName1"_`date +%Y-%m-%d`.sql"
    fileName2=$dbName2"_`date +%Y-%m-%d`.sql"
    fileName3=$dbName3"_`date +%Y-%m-%d`.sql"
    fileName4=$dbName4"_`date +%Y-%m-%d`.sql"
    fileName5=$dbName5"_`date +%Y-%m-%d`.sql"
    fileName6=$dbName6"_`date +%Y-%m-%d`.sql"
    fileName7=$dbName7"_`date +%Y-%m-%d`.sql"
    fileName8=$dbName8"_`date +%Y-%m-%d`.sql"
    fileName9=$dbName9"_`date +%Y-%m-%d`.sql"
    fileName1=$dbName10"_`date +%Y-%m-%d`.sql"
    fileName2=$dbName11"_`date +%Y-%m-%d`.sql"
    fileName3=$dbName12"_`date +%Y-%m-%d`.sql"
    fileName4=$dbName13"_`date +%Y-%m-%d`.sql"
    fileName5=$dbName14"_`date +%Y-%m-%d`.sql"
    fileName6=$dbName15"_`date +%Y-%m-%d`.sql"
    fileName7=$dbName16"_`date +%Y-%m-%d`.sql"
    fileName8=$dbName17"_`date +%Y-%m-%d`.sql"
    fileName9=$dbName18"_`date +%Y-%m-%d`.sql"
    fileName1=$dbName19"_`date +%Y-%m-%d`.sql"
    fileName2=$dbName20"_`date +%Y-%m-%d`.sql"
    fileName3=$dbName21"_`date +%Y-%m-%d`.sql"
    fileName4=$dbName22"_`date +%Y-%m-%d`.sql"
    fileName5=$dbName23"_`date +%Y-%m-%d`.sql"
    fileName6=$dbName24"_`date +%Y-%m-%d`.sql"
    fileName7=$dbName25"_`date +%Y-%m-%d`.sql"
    fileName8=$dbName26"_`date +%Y-%m-%d`.sql"
    fileName9=$dbName27"_`date +%Y-%m-%d`.sql"
    fileName1=$dbName28"_`date +%Y-%m-%d`.sql"
    fileName2=$dbName29"_`date +%Y-%m-%d`.sql"
    fileName3=$dbName30"_`date +%Y-%m-%d`.sql"
    fileName4=$dbName31"_`date +%Y-%m-%d`.sql"
    fileName5=$dbName32"_`date +%Y-%m-%d`.sql"
    fileName6=$dbName33"_`date +%Y-%m-%d`.sql"
    fileName7=$dbName34"_`date +%Y-%m-%d`.sql"
    fileName8=$dbName35"_`date +%Y-%m-%d`.sql"
    fileName9=$dbName36"_`date +%Y-%m-%d`.sql"
    fileName4=$dbName37"_`date +%Y-%m-%d`.sql"
    fileName5=$dbName38"_`date +%Y-%m-%d`.sql"
    fileName6=$dbName39"_`date +%Y-%m-%d`.sql"
    fileName7=$dbName40"_`date +%Y-%m-%d`.sql"
    fileName8=$dbName41"_`date +%Y-%m-%d`.sql"
    fileName9=$dbName42"_`date +%Y-%m-%d`.sql"
    fileName7=$dbName43"_`date +%Y-%m-%d`.sql"
    fileName8=$dbName44"_`date +%Y-%m-%d`.sql"
    fileName9=$dbName45"_`date +%Y-%m-%d`.sql"
    fileName7=$dbName46"_`date +%Y-%m-%d`.sql"
    
    backupDir="/ndffs/c04345/h45605/mnt/2325324/domains/backups"
    
    #mysqldump -u db2325324 --password=MYPASSWORD --all-databases --single-transaction > allDBs.filz
    mysqldump -u db2325324 --password=MYPASSWORD $dbName1 > $backupDir/$fileName1
    mysqldump -u db2325324 --password=MYPASSWORD $dbName2 > $backupDir/$fileName2
    mysqldump -u db2325324 --password=MYPASSWORD $dbName3 > $backupDir/$fileName3
    mysqldump -u db2325324 --password=MYPASSWORD $dbName4 > $backupDir/$fileName4
    mysqldump -u db2325324 --password=MYPASSWORD $dbName5 > $backupDir/$fileName5
    mysqldump -u db2325324 --password=MYPASSWORD $dbName6 > $backupDir/$fileName6
    mysqldump -u db2325324 --password=MYPASSWORD $dbName7 > $backupDir/$fileName7
    mysqldump -u db2325324 --password=MYPASSWORD $dbName8 > $backupDir/$fileName8
    mysqldump -u db2325324 --password=MYPASSWORD $dbName9 > $backupDir/$fileName9
    mysqldump -u db2325324 --password=MYPASSWORD $dbName10 > $backupDir/$fileName10
    mysqldump -u db2325324 --password=MYPASSWORD $dbName11 > $backupDir/$fileName11
    mysqldump -u db2325324 --password=MYPASSWORD $dbName12 > $backupDir/$fileName12
    mysqldump -u db2325324 --password=MYPASSWORD $dbName13 > $backupDir/$fileName13
    mysqldump -u db2325324 --password=MYPASSWORD $dbName14 > $backupDir/$fileName14
    mysqldump -u db2325324 --password=MYPASSWORD $dbName15 > $backupDir/$fileName15
    mysqldump -u db2325324 --password=MYPASSWORD $dbName16 > $backupDir/$fileName16
    mysqldump -u db2325324 --password=MYPASSWORD $dbName17 > $backupDir/$fileName17
    mysqldump -u db2325324 --password=MYPASSWORD $dbName18 > $backupDir/$fileName18
    mysqldump -u db2325324 --password=MYPASSWORD $dbName19 > $backupDir/$fileName19
    mysqldump -u db2325324 --password=MYPASSWORD $dbName20 > $backupDir/$fileName20
    mysqldump -u db2325324 --password=MYPASSWORD $dbName21 > $backupDir/$fileName21
    mysqldump -u db2325324 --password=MYPASSWORD $dbName22 > $backupDir/$fileName2
    mysqldump -u db2325324 --password=MYPASSWORD $dbName23 > $backupDir/$fileName23
    mysqldump -u db2325324 --password=MYPASSWORD $dbName24 > $backupDir/$fileName24
    mysqldump -u db2325324 --password=MYPASSWORD $dbName25 > $backupDir/$fileName25
    mysqldump -u db2325324 --password=MYPASSWORD $dbName26 > $backupDir/$fileName26
    mysqldump -u db2325324 --password=MYPASSWORD $dbName27 > $backupDir/$fileName27
    mysqldump -u db2325324 --password=MYPASSWORD $dbName28 > $backupDir/$fileName28
    mysqldump -u db2325324 --password=MYPASSWORD $dbName29 > $backupDir/$fileName29
    mysqldump -u db2325324 --password=MYPASSWORD $dbName30 > $backupDir/$fileName30
    mysqldump -u db2325324 --password=MYPASSWORD $dbName31 > $backupDir/$fileName31
    mysqldump -u db2325324 --password=MYPASSWORD $dbName32 > $backupDir/$fileName32
    mysqldump -u db2325324 --password=MYPASSWORD $dbName33 > $backupDir/$fileName33
    mysqldump -u db2325324 --password=MYPASSWORD $dbName34 > $backupDir/$fileName34
    mysqldump -u db2325324 --password=MYPASSWORD $dbName35 > $backupDir/$fileName35
    mysqldump -u db2325324 --password=MYPASSWORD $dbName36 > $backupDir/$fileName36
    mysqldump -u db2325324 --password=MYPASSWORD $dbName37 > $backupDir/$fileName37
    mysqldump -u db2325324 --password=MYPASSWORD $dbName38 > $backupDir/$fileName38
    mysqldump -u db2325324 --password=MYPASSWORD $dbName39 > $backupDir/$fileName39
    mysqldump -u db2325324 --password=MYPASSWORD $dbName40 > $backupDir/$fileName40
    mysqldump -u db2325324 --password=MYPASSWORD $dbName41 > $backupDir/$fileName41
    mysqldump -u db2325324 --password=MYPASSWORD $dbName42 > $backupDir/$fileName42
    mysqldump -u db2325324 --password=MYPASSWORD $dbName43 > $backupDir/$fileName43
    mysqldump -u db2325324 --password=MYPASSWORD $dbName44 > $backupDir/$fileName44
    mysqldump -u db2325324 --password=MYPASSWORD $dbName45 > $backupDir/$fileName45
    mysqldump -u db2325324 --password=MYPASSWORD $dbName46 > $backupDir/$fileName46
    
    bzip2 $backupDir/$fileName1
    bzip2 $backupDir/$fileName2
    bzip2 $backupDir/$fileName3
    bzip2 $backupDir/$fileName4
    bzip2 $backupDir/$fileName5
    bzip2 $backupDir/$fileName6
    bzip2 $backupDir/$fileName7
    bzip2 $backupDir/$fileName8
    bzip2 $backupDir/$fileName9
    bzip2 $backupDir/$fileName10
    bzip2 $backupDir/$fileName11
    bzip2 $backupDir/$fileName12
    bzip2 $backupDir/$fileName13
    bzip2 $backupDir/$fileName14
    bzip2 $backupDir/$fileName15
    bzip2 $backupDir/$fileName16
    bzip2 $backupDir/$fileName17
    bzip2 $backupDir/$fileName18
    bzip2 $backupDir/$fileName19
    bzip2 $backupDir/$fileName20
    bzip2 $backupDir/$fileName21
    bzip2 $backupDir/$fileName22
    bzip2 $backupDir/$fileName23
    bzip2 $backupDir/$fileName24
    bzip2 $backupDir/$fileName25
    bzip2 $backupDir/$fileName26
    bzip2 $backupDir/$fileName27
    bzip2 $backupDir/$fileName28
    bzip2 $backupDir/$fileName29
    bzip2 $backupDir/$fileName30
    bzip2 $backupDir/$fileName31
    bzip2 $backupDir/$fileName32
    bzip2 $backupDir/$fileName33
    bzip2 $backupDir/$fileName34
    bzip2 $backupDir/$fileName35
    bzip2 $backupDir/$fileName36
    bzip2 $backupDir/$fileName37
    bzip2 $backupDir/$fileName38
    bzip2 $backupDir/$fileName39
    bzip2 $backupDir/$fileName40
    bzip2 $backupDir/$fileName41
    bzip2 $backupDir/$fileName42
    bzip2 $backupDir/$fileName43
    bzip2 $backupDir/$fileName44
    bzip2 $backupDir/$fileName45
    bzip2 $backupDir/$fileName46
    
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName1".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName2".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName3".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName4".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName5".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName6".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName7".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName8".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName9".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName10".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName11".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName12".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName13".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName14".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName15".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName16".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName17".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName18".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName19".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName20".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName21".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName22".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName23".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName24".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName25".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName26".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName27".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName28".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName29".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName30".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName31".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName32".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName33".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName34".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName35".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName36".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName37".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName38".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName39".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName40".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName41".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName42".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName43".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName44".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName45".bz2"
    gpg -c --passphrase ‘MyEncryptionP@ZZphras3‘ $backupDir/$fileName46".bz2"
    
    echo "backups completed" | mutt -s "Backups for `date +%D`" -a $backupDir/*.gpg -- email@test.com
    
    rm $backupDir/*.gpg
    echo "Backups completed on `date +%D`" >> $backupDir/backuplog.log
    But i get these errors sent to my email by the cron job after creating few files in the right location

    Code:
    mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
    mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
    mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
    mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
    mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
    mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
    mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
    mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
    mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
    /home/2325324/domains/backups.sh: line 108: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 109: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 110: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 111: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 112: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 113: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 114: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 115: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 116: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 117: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 118: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 119: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
    /home/2325324/domains/backups.sh: line 121: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 122: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 123: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 124: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 125: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 126: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 127: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 128: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 129: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 130: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 131: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 132: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 133: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 134: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 135: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 136: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 137: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 138: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 139: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 140: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 141: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 142: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 143: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    /home/2325324/domains/backups.sh: line 144: /ndffs/c04345/h45605/mnt/2325324/domains/backups: Is a directory
    bzip2: Output file /ndffs/c04345/h45605/mnt/2325324/domains/backupsdb2325324_loyaltyprogramvendors_2013-02-12.sql.bz2 already exists.
    bzip2: Output file /ndffs/c04345/h45605/mnt/2325324/domains/backupsdb2325324_membershipretentionideas_2013-02-12.sql.bz2 already exists.
    bzip2: Output file /ndffs/c04345/h45605/mnt/2325324/domains/backupsdb2325324_onlineaffiliateprogramguide_2013-02-12.sql.bz2 already exists.
    bzip2: Output file /ndffs/c04345/h45605/mnt/2325324/domains/backupsdb2325324_retailbrandguide_2013-02-12.sql.bz2 already exists.
    bzip2: Output file /ndffs/c04345/h45605/mnt/2325324/domains/backupsdb2325324_retailfranchisecentral_2013-02-12.sql.bz2 already exists.
    bzip2: Output file /ndffs/c04345/h45605/mnt/2325324/domains/backupsdb2325324_retentionguide_2013-02-12.sql.bz2 already exists.
    bzip2: Output file /ndffs/c04345/h45605/mnt/2325324/domains/backupsdb2325324_upsellingtechniques_2013-02-12.sql.bz2 already exists.
    bzip2: Output file /ndffs/c04345/h45605/mnt/2325324/domains/backupsdb2325324_socialreferralcentral_2013-02-12.sql.bz2 already exists.
    bzip2: Output file /ndffs/c04345/h45605/mnt/2325324/domains/backupsdb2325324_upsellguide_2013-02-12.sql.bz2 already exists.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    bzip2: Input file /ndffs/c04345/h45605/mnt/2325324/domains/backups is a directory.
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    gpg: fatal: can't create directory `/home/2325324/.gnupg': Permission denied
    secmem usage: 64/64 bytes in 1/1 blocks of pool 64/32768
    /home/2325324/domains/backups.sh: line 240: mutt: command not found
    rm: cannot remove `/ndffs/c04345/h45605/mnt/2325324/domains/backups*.gpg': No such file or directory

  2. #22
    Just Joined! msohail's Avatar
    Join Date
    Nov 2011
    Posts
    47
    Quote Originally Posted by Website View Post
    My username is not root. I dont have root proviliges. but i have ssh and i put the codes in a sh file and ran it through cron jobs.

    I dont get any error or anything when i run the script through cron job. How can i get a output?
    Even if you dont use mysql user as root, it will be enough if your mysql user has ample privileges over the databases you want to take backup of.

    As requested earlier, can you give me the output for

    Code:
    mysql -uDBUSERNAME -pPASSWORD -e "show databases;" | awk '{print $1}'
    Jazak Allah
    Sohail

  3. #23
    Just Joined!
    Join Date
    Aug 2012
    Posts
    54
    Quote Originally Posted by msohail View Post
    Even if you dont use mysql user as root, it will be enough if your mysql user has ample privileges over the databases you want to take backup of.

    As requested earlier, can you give me the output for

    Code:
    mysql -uDBUSERNAME -pPASSWORD -e "show databases;" | awk '{print $1}'
    Jazak Allah
    Sohail

    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

  4. #24
    Just Joined! msohail's Avatar
    Join Date
    Nov 2011
    Posts
    47
    Quote Originally Posted by Website View Post
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
    Please restart mysql service. It may not be running.

    Jazak Allah
    Sohail

  5. #25
    Just Joined!
    Join Date
    Aug 2012
    Posts
    54
    Quote Originally Posted by Website View Post
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
    I have a media temple account. Their shared service gives you SSH access but not root priviliges. so I cant stop nor start mysql.

  6. #26
    Just Joined! msohail's Avatar
    Join Date
    Nov 2011
    Posts
    47
    Quote Originally Posted by Website View Post
    I have a media temple account. Their shared service gives you SSH access but not root priviliges. so I cant stop nor start mysql.
    Can you try adding the hostname or the IP address, something like this ?

    Code:
    mysql -uDBUSERNAME -pPASSWORD -hHOSTNAME -e "show databases;" | awk '{print $1}'
    
    OR
    
    mysql -uDBUSERNAME -pPASSWORD -hIP_ADDRESS -e "show databases;" | awk '{print $1}'

  7. #27
    Just Joined! msohail's Avatar
    Join Date
    Nov 2011
    Posts
    47
    Quote Originally Posted by msohail View Post
    Can you try adding the hostname or the IP address, something like this ?

    Code:
    mysql -uDBUSERNAME -pPASSWORD -hHOSTNAME -e "show databases;" | awk '{print $1}'
    
    OR
    
    mysql -uDBUSERNAME -pPASSWORD -hIP_ADDRESS -e "show databases;" | awk '{print $1}'

    If you are still getting the same error then you might want to contact the hosting providers with this error.

    Jazak Allah
    Sohail

  8. #28
    Just Joined!
    Join Date
    Aug 2012
    Posts
    54
    Quote Originally Posted by msohail View Post
    If you are still getting the same error then you might want to contact the hosting providers with this error.

    Jazak Allah
    Sohail
    Code:
    Database
    information_schema
    db244952345_affiliatemarketingprogramguide
    db244952345_affiliatepartnershipguide
    db244952345_affiliateprogramjournal
    db244952345_affiliatesolutionguide
    db244952345_brandadvocacycentral
    db244952345_brandadvocacyguide
    db244952345_churnratereductionguide
    db244952345_customeradvocacycentral
    db244952345_customeradvocacyguide
    db244952345_customerloyaltycentral
    db244952345_franchisemarketingcentral
    db244952345_franchisesuccessguide
    db244952345_gamificationcentral
    db244952345_localpromotionsguide
    db244952345_loyaltyjournal
    db244952345_loyaltymanagerguide
    db244952345_loyaltyprogramguide
    db244952345_loyaltyprogramvendors
    db244952345_membershipretentionideas
    db244952345_onlineaffiliateprogramguide
    db244952345_opengraphintegrationguide
    db244952345_partnershipmanagerguide
    db244952345_partnershipprogramguide
    db244952345_promotionpartnerscentral
    db244952345_promotionpartnersguide
    db244952345_referraljournal
    db244952345_retailbrandguide
    db244952345_retailfranchisecentral
    db244952345_retentionguide
    db244952345_saasretentionguide
    db244952345_socialadvocacyguide
    db244952345_socialgraphpromotionsguide
    db244952345_socialloyaltyguide
    db244952345_socialreferralcentral
    db244952345_upsellguide
    db244952345_upsellingtechniques

  9. #29
    Just Joined! msohail's Avatar
    Join Date
    Nov 2011
    Posts
    47
    Quote Originally Posted by Website View Post
    Code:
    Database
    information_schema
    db244952345_affiliatemarketingprogramguide
    db244952345_affiliatepartnershipguide
    db244952345_affiliateprogramjournal
    db244952345_affiliatesolutionguide
    db244952345_brandadvocacycentral
    db244952345_brandadvocacyguide
    db244952345_churnratereductionguide
    db244952345_customeradvocacycentral
    db244952345_customeradvocacyguide
    db244952345_customerloyaltycentral
    db244952345_franchisemarketingcentral
    db244952345_franchisesuccessguide
    db244952345_gamificationcentral
    db244952345_localpromotionsguide
    db244952345_loyaltyjournal
    db244952345_loyaltymanagerguide
    db244952345_loyaltyprogramguide
    db244952345_loyaltyprogramvendors
    db244952345_membershipretentionideas
    db244952345_onlineaffiliateprogramguide
    db244952345_opengraphintegrationguide
    db244952345_partnershipmanagerguide
    db244952345_partnershipprogramguide
    db244952345_promotionpartnerscentral
    db244952345_promotionpartnersguide
    db244952345_referraljournal
    db244952345_retailbrandguide
    db244952345_retailfranchisecentral
    db244952345_retentionguide
    db244952345_saasretentionguide
    db244952345_socialadvocacyguide
    db244952345_socialgraphpromotionsguide
    db244952345_socialloyaltyguide
    db244952345_socialreferralcentral
    db244952345_upsellguide
    db244952345_upsellingtechniques

    Seems to be running fine. If you added the hostname and got this result, can you do the same editing in the script I gave you, that is, adding hostname/IP address in the script ?

    You should have your results this time. Make sure the destination folder is writable by other users.

    Jazak Allah
    Sohail

  10. #30
    Just Joined! msohail's Avatar
    Join Date
    Nov 2011
    Posts
    47
    Quote Originally Posted by msohail View Post
    Seems to be running fine. If you added the hostname and got this result, can you do the same editing in the script I gave you, that is, adding hostname/IP address in the script ?

    You should have your results this time. Make sure the destination folder is writable by other users.

    Jazak Allah
    Sohail
    Seems like the hosting providers enabled binding address feature in mysql.

Page 3 of 4 FirstFirst 1 2 3 4 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •