-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmage-bundle.sh
More file actions
executable file
·50 lines (36 loc) · 1.23 KB
/
mage-bundle.sh
File metadata and controls
executable file
·50 lines (36 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
PWD=$(pwd)
KEY=$(wget -qO - http://pwgen.sonassi.com)
FILENAME="http_$KEY.tgz"
EXCLUDES=( "./var/log/*" "./var/cache/*" "./var/session/*" "./var/*port/*" "./var/tmp/*" "./media" "./errors/*" "./export/*" "./.git" "*.tar" "*.tgz" "*.gz" "*.bz2" "*.zip" "*.sql" "*.pdf" "*.mp3" "*.mp4" "*.mov" "*.avi" "./app/etc/local.xml" "./$FILENAME" )
echo -n "Please confirm you want to bundle ($PWD) [y/N]: "
read CONFIRM
[[ ! "$CONFIRM" == "y" ]] && exit 1
function build_excludes()
{
EXCLUDES_ALL=""
for EXCLUDE in "${EXCLUDES[@]}"; do
EXCLUDES_ALL="--exclude=$EXCLUDE $EXCLUDES_ALL"
done
echo $EXCLUDES_ALL
}
wget sys.sonassi.com/mage-dbdump.sh
bash mage-dbdump.sh
tar chvfz $PWD/$FILENAME $(build_excludes) . var/db.sql
cat << EOF
#######################################
MYSQL DUMP & TAR COMPLETE
Backup Location: $FILENAME
########################################
EOF
cat <<EOT
########################################
(_)
___ ___ _ __ __ _ ___ ___ _
/ __|/ _ \| '_ \ / _' / __/ __| |
\__ \ (_) | | | | (_| \__ \__ \ |
|___/\___/|_| |_|\__'_|___/___/_|
Want truly optimised Magento hosting?
Try http://www.sonassihosting.com ...
#########################################
EOT