File tree Expand file tree Collapse file tree 3 files changed +24
-12
lines changed
Expand file tree Collapse file tree 3 files changed +24
-12
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ check_hestia_demo_mode
3939# Action #
4040# ----------------------------------------------------------#
4141
42+ # Create timestamp in Y-M-D_h-m-s format
43+ timestamp=$( date +' %G-%m-%d_%H-%M-%S' )
44+
4245# Check db existence
4346db_data=$( grep " DB='$database '" $HESTIA /data/users/$user /db.conf)
4447if [ -z " $db_data " ]; then
@@ -61,10 +64,16 @@ case $TYPE in
6164esac
6265
6366if [ " $output " = " file" ]; then
64- cp $dump $BACKUP /$user .$database .$TYPE .sql
65- echo $BACKUP /$user .$database .$TYPE .sql
67+ # echo filename for use in the php
68+ echo " ${user} _${database} _${TYPE} _${timestamp} .sql"
69+
70+ cp $dump $BACKUP /${user} _${database} _${TYPE} _${timestamp} .sql
71+
72+ # echo file location for use in the php
73+ echo " $BACKUP /${user} _${database} _${TYPE} _${timestamp} .sql"
6674
67- echo " rm $BACKUP /$user .$database .$TYPE .sql" | at now + 1 hour
75+ # cleanup
76+ echo " rm $BACKUP /${user} _${database} _${TYPE} _${timestamp} .sql" | at now + 1 hour
6877else
6978 cat $dump
7079fi
Original file line number Diff line number Diff line change @@ -40,20 +40,23 @@ check_hestia_demo_mode
4040# Create timestamp in Y-M-D_h-m-s format
4141timestamp=$( date +' %G-%m-%d_%H-%M-%S' )
4242
43- # echo filename for use in the php
44- echo " $user .$domain .$timestamp .zip"
45-
4643if [ " $type " = " full" ]; then
4744 cd /home/$user /web/$domain /
4845else
4946 cd /home/$user /web/$domain /public_html/
5047fi
5148
52- zip -rq $BACKUP /$user .$domain .$timestamp .zip .
49+ zip -rq $BACKUP /${user} _${domain} _${timestamp} .zip .
50+
51+ if [[ -f " $BACKUP /${user} _${domain} _${timestamp} .zip" ]]; then
52+ # echo filename for use in the php
53+ echo " ${user} _${domain} _${timestamp} .zip"
54+
55+ # echo file location for use in the php
56+ echo " $BACKUP /${user} _${domain} _${timestamp} .zip"
5357
54- if [[ -f " $BACKUP /$user .$domain .$timestamp .zip" ]]; then
55- echo " $BACKUP /$user .$domain .$timestamp .zip"
56- echo " rm $BACKUP /$user .$domain .$timestamp .zip" | at now + 1 hour
58+ # cleanup
59+ echo " rm $BACKUP /${user} _${domain} _${timestamp} .zip" | at now + 1 hour
5760fi
5861
5962# ----------------------------------------------------------#
Original file line number Diff line number Diff line change 1313
1414if ($ return_var == 0 ) {
1515 header ("Content-type: application/sql " );
16- header ("Content-Disposition: attachment; filename= \"" . $ _GET [ " database " ] . " .sql \" ; " );
17- header ("X-Accel-Redirect: " . $ output [0 ]);
16+ header ("Content-Disposition: attachment; filename= " . $ output [ 0 ] );
17+ header ("X-Accel-Redirect: " . $ output [1 ]);
1818}
You can’t perform that action at this time.
0 commit comments