Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
ce74d0ac
Commit
ce74d0ac
authored
Jul 21, 2015
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
archive_site: add -f for force, skip tarball if site dir does not exists, use zpaq
parent
1eec9d1a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
archive_site.sh
web/archive_site.sh
+15
-4
No files found.
web/archive_site.sh
View file @
ce74d0ac
#!/bin/sh
# remove site to archive:
# $ archive_site.sh /path/to/site
if
[
"
$1
"
=
"-f"
]
;
then
shift
FORCE
=
1
fi
test
"
$1
"
||
exit
1
SITEPATH
=
"
$(
realpath
$1
)
"
...
...
@@ -14,13 +20,18 @@ IPHOST=91.232.225.9
if
[
-n
"
$IP
"
]
&&
[
"
$IP
"
=
"
$IPHOST
"
]
;
then
echo
"
$DOMAINNAME
still on
$IPHOST
IP (
$IP
really)"
exit
[
-n
"
$FORCE
"
]
||
exit
fi
test
-n
"
$USERNAME
"
||
exit
test
-d
"/home/
$USERNAME
"
||
exit
test
-n
"
$DOMAINNAME
"
||
exit
try_rm_user
()
{
rmdir
"/home/
$USERNAME
/www"
&&
rm
-vrf
/home/
$USERNAME
/
&&
userdel
$USERNAME
}
cd
$(
dirname
$0
)
||
exit
.
./config
...
...
@@ -40,11 +51,11 @@ echo "$conffile"
mkdir
-p
/home/archive
mv
$conffile
/home/archive/
$conffile
cd
"
$SITEPATH
"
||
exit
erc a
/home/archive/
$DOMAINNAME
.tar.xz
.
||
exit
cd
"
$SITEPATH
"
||
{
try_rm_user
;
exit
;
}
erc a
dd /home/archive/
$DOMAINNAME
.zpaq
.
||
exit
rm
-vrf
"
$SITEPATH
"
rmdir
"/home/
$USERNAME
/www"
&&
rm
-vrf
/home/
$USERNAME
/
&&
userdel
$USERNAME
try_rm_user
cd
/
serv httpd2 reload
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment