Split project from class-repo to it's own repo (this one right here) and updated some files
This commit is contained in:
parent
af61cc9875
commit
84b681baf0
17
LICENSE
Normal file
17
LICENSE
Normal file
@ -0,0 +1,17 @@
|
||||
Copyright (C) 2014 Jack-Benny Persson <jack-benny@cyberinfo.se>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
21
README.md
21
README.md
@ -1,7 +1,6 @@
|
||||
# Serverbackup #
|
||||
This is exercise 6 on lab 5 which is about writing a backup script for your
|
||||
server.
|
||||
For this exercise I've chosen to make a backup script for Proxmox, ie take all
|
||||
This script was written as a part of a Programming & Scripting class.
|
||||
The script takes a backup of the backup files created by Proxmox, ie take all
|
||||
the backup files (vzdump-openvz-111-2013\_11\_19-08\_20\_20.tar.lzo and so on)
|
||||
and copy them to a tape device and an external harddrive.
|
||||
|
||||
@ -41,10 +40,18 @@ track on which tape you last used for your backup so you'll know which tape
|
||||
to use next. Either you can run the script by itself or include it on the same
|
||||
line as serverbackup such as `./serverbackup.sh && ./taperotate.sh`. Each time
|
||||
taperotate is run a new line is printed in the tapefile.txt file which contains
|
||||
the tape used. The next time the script is run it automatically increases the tape
|
||||
number by one.
|
||||
the tape used. The next time the script is run it automatically increases the
|
||||
tape number by one.
|
||||
|
||||
The first time you run taperotate.sh you'll have to initialize it with the -i N
|
||||
option where N is the tape you start with. If you change the order of the tapes
|
||||
later on you can use the -i option again to start over with tape N (the old lines
|
||||
will be kept though to keep track on the old backups).
|
||||
later on you can use the -i option again to start over with tape N (the old
|
||||
lines will be kept though to keep track on the old backups).
|
||||
|
||||
### Flowchart, specs and notes ###
|
||||
You can ignore these files as they are just a part of the inital lab/exercise
|
||||
for the class and for my own memory.
|
||||
|
||||
### Dummyfiles ###
|
||||
These are some dummy backup files to test the script on. They have the same
|
||||
format as the real Proxmox created files.
|
||||
|
@ -1,8 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Jack-Benny Persson
|
||||
# LX13
|
||||
# Serverbackup.sh (Övning 6, labb 5)
|
||||
################################################################################
|
||||
# #
|
||||
# Copyright (C) 2014 Jack-Benny Persson <jack-benny@cyberinfo.se> #
|
||||
# #
|
||||
# This program is free software; you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
# the Free Software Foundation; either version 2 of the License, or #
|
||||
# (at your option) any later version. #
|
||||
# #
|
||||
# This program is distributed in the hope that it will be useful, #
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||
# GNU General Public License for more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License #
|
||||
# along with this program; if not, write to the Free Software #
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
# #
|
||||
################################################################################
|
||||
|
||||
## Variables ##
|
||||
# Define some settings for the script
|
||||
|
4
specs.md
4
specs.md
@ -4,7 +4,9 @@
|
||||
2. Extract the dates from the filenames
|
||||
3. Check whatever a tape drive is on and contains a tape
|
||||
4. Check whatever the external harddrive is connected
|
||||
* If not, try to mount it
|
||||
* If it is, try to mount it
|
||||
* If mount fails, abort script and write error log
|
||||
5. Copy the latest backup to tape drive and external harddrive
|
||||
6. Write everything to a logfile (script will run headless)
|
||||
* No, doesn't do that. Instead write all error to stderr and normal
|
||||
output to stdout
|
||||
|
Loading…
x
Reference in New Issue
Block a user