We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c722d3 commit d44e6f0Copy full SHA for d44e6f0
backup.sh
@@ -0,0 +1,21 @@
1
+#!/bin/sh
2
+
3
+DIRNAME=/var/www/html/project
4
+ARCHIVE=backup_$(date +%Y_%m_%d)
5
+DBUSER=root
6
+DBPASSWORD=password
7
+DBNAME=project
8
9
10
+echo "dumping database ..."
11
12
+mysqldump -u ${DBUSER} -p"${DBPASSWORD}" ${DBNAME} > "${DIRNAME}/dump.sql"
13
14
+echo "zip archive ..."
15
16
+tar -czf "${ARCHIVE}.tar.gz" ${DIRNAME}/ --exclude="${DIRNAME}/node_modules" --exclude="${DIRNAME}/vendor" --exclude="${DIRNAME}/.git" --exclude="${DIRNAME}/.idea" --exclude="${DIRNAME}/storage/logs/*"
17
18
+rm "${DIRNAME}/dump.sql"
19
20
21
+echo "success"
0 commit comments