first commit
This commit is contained in:
commit
a1fb5f702d
35
backup
Executable file
35
backup
Executable file
@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo '
|
||||||
|
________ ________ ________ ___ __ ___ ___ ________ _________ ________ ________ ___
|
||||||
|
|\ __ \|\ __ \|\ ____\|\ \|\ \ |\ \|\ \|\ __ \ |\___ ___\\ __ \|\ __ \|\ \
|
||||||
|
\ \ \|\ /\ \ \|\ \ \ \___|\ \ \/ /|\ \ \\\ \ \ \|\ \ \|___ \ \_\ \ \|\ \ \ \|\ \ \ \
|
||||||
|
\ \ __ \ \ __ \ \ \ \ \ ___ \ \ \\\ \ \ ____\ \ \ \ \ \ \\\ \ \ \\\ \ \ \
|
||||||
|
\ \ \|\ \ \ \ \ \ \ \____\ \ \\ \ \ \ \\\ \ \ \___| \ \ \ \ \ \\\ \ \ \\\ \ \ \_____
|
||||||
|
\ \_______\ \__\ \__\ \_______\ \__\\ \__\ \_______\ \__\ \ \__\ \ \_______\ \_______\ \_______\
|
||||||
|
\|_______|\|__|\|__|\|_______|\|__| \|__|\|_______|\|__| \|__| \|_______|\|_______|\|_______|'
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
echo 'backing up the following folders:'
|
||||||
|
echo -e "\e[32m-------------------------------------------"
|
||||||
|
cat *.bak
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
echo -e "\e[0mStarting Backup"
|
||||||
|
|
||||||
|
tar -cvf /nas/share/backup.tar ./*.bak
|
||||||
|
|
||||||
|
while read folder; do
|
||||||
|
# list the contents of each folder
|
||||||
|
echo -e "\e[32mbackingup: $folder"
|
||||||
|
tar -rf /nas/share/backup.tar $folder &>/dev/null
|
||||||
|
done < *.bak
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
#echo -e "\e[0mCompressing backup"
|
||||||
|
|
||||||
|
#gzip /nas/share/backup.tar
|
||||||
|
|
||||||
|
echo -e "\e[0mBackup Done"
|
3
backup.bak
Normal file
3
backup.bak
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/var/www
|
||||||
|
/etc/apache2
|
||||||
|
/home/brickman
|
Loading…
Reference in New Issue
Block a user