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
74b041e0
Commit
74b041e0
authored
Apr 21, 2016
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add vzarchive scripts
parent
c2e8f1c9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
vzarchive.sh
vz/vzarchive.sh
+21
-0
vzarchive_cellar.sh
vz/vzarchive_cellar.sh
+15
-0
No files found.
vz/vzarchive.sh
0 → 100755
View file @
74b041e0
#!/bin/bash
SERVER
=
$1
DESTINATION
=
/var/ftp/pvt/Etersoft/ARCHIVE/vz/
$1
/
$2
[
$#
-ne
2
]
&&
echo
'Input HOSTNAME and VEID as parameters...'
&&
exit
1
mkdir
-p
"
$DESTINATION
"
if
[
-f
"
$DESTINATION
/root_
$2
.tar.gz"
]
then
echo
"WARNING ! The destination archive exists... Remove it manually."
exit
3
fi
ssh
$SERVER
"tar -czf /tmp/root_
$2
.tar.gz -C /var/lib/vz/private/
$2
"
||
exit
2
scp
$SERVER
:/tmp/root_
$2
.tar.gz
"
$DESTINATION
"
&&
ssh
$SERVER
"rm -f /tmp/root_
$2
.tar.gz"
scp
$SERVER
:/etc/vz/conf/
$2
.conf
"
$DESTINATION
"
&&
ssh
$SERVER
"rm -f /etc/vz/conf/
$2
.conf"
scp
$SERVER
:/etc/vz/conf/
$2
.mount
"
$DESTINATION
"
&&
ssh
$SERVER
"rm -f /etc/vz/conf/
$2
.mount"
scp
$SERVER
:/etc/vz/conf/
$2
.umount
"
$DESTINATION
"
&&
ssh
$SERVER
"rm -f /etc/vz/conf/
$2
.umount"
vz/vzarchive_cellar.sh
0 → 100755
View file @
74b041e0
#!/bin/bash
DESTINATION
=
/var/ftp/pvt/Etersoft/ARCHIVE/vz/cellar
mkdir
-p
"
$DESTINATION
"
[
$#
-eq
0
]
&&
echo
'Input VEID as parameter...'
&&
exit
1
tar
-czf
root_
$1
.tar.gz
-C
/var/lib/vz/private/
$1
||
exit
2
mkdir
"
$DESTINATION
"
/
$1
mv
-v
root_
$1
.tar.gz
"
$DESTINATION
"
/
$1
mv
-v
/etc/vz/conf/
$1
.conf
"
$DESTINATION
"
/
$1
/
mv
-v
/etc/vz/conf/
$1
.mount
"
$DESTINATION
"
/
$1
/
mv
-v
/etc/vz/conf/
$1
.umount
"
$DESTINATION
"
/
$1
/
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