You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,8 @@ On Debian this should do: **sudo apt install pv gzip**
11
11
12
12
# MySQL/MariaDB
13
13
The script will ask for mysql user and password confirmation each time you dump a database.
14
-
If this bothers you, then you should create a .my.cnf file.
14
+
If this bothers you, then you should create a .my.cnf file (see below) and **also** you should remove "-u root -p" from the mysql commands to avoid trying to connect as root if ***you don't have to***.
15
+
15
16
## .my.cnf – mysql user & password
16
17
Create file ~/.my.cnf and add following lines in it and replace mysqluser & mysqlpass values.
Copy file name to clipboardExpand all lines: fullsysbackup.sh
+6-6
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,10 @@
2
2
3
3
###### Configuration ######
4
4
5
-
# Enter the backup location - Where should we save our files?
5
+
# Enter the backup location - Where should we save our files? (You should change this)
6
6
backuplocation="/home/user/fullsysbackup"
7
7
8
-
# Enter full paths of folders to include in our backup archive.
8
+
# Enter full paths of folders to include in our backup archive. (You should change these)
9
9
backuppaths=(
10
10
/home/user
11
11
/root
@@ -18,10 +18,10 @@ backuppaths=(
18
18
###### End Of Configuration ######
19
19
20
20
# sudo is required
21
-
if [[ $UID!= 0 ]];then
22
-
printf"Permission Denied: run this script with sudo privileges. You will also be promped to enter mysql credentials unless you have a .my.cnf file in place. See README.md\n"
23
-
printf"sudo $0$*"
24
-
exit1
21
+
printf"\e[1mThis script needs sudo privileges. You will also be promped to enter mysql credentials for each database you export unless you have a .my.cnf file in place. See README.md\e[0m\n"
22
+
if [ $EUID!= 0 ];then
23
+
sudo "$0""$@"
24
+
exit$?
25
25
fi
26
26
27
27
printf"%b""\e[1mChecking for required package: pv\e[0m\n"
0 commit comments