15
This commit is contained in:
21
beispiele/15/schubertdaniel.conf
Normal file
21
beispiele/15/schubertdaniel.conf
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
|
||||
<VirtualHost 144.76.58.9:80 [2a01:4f8:191:6204:0:0:0:2]:80 >
|
||||
|
||||
ServerName www.schubertdaniel.de
|
||||
ServerAlias schubertdaniel.de
|
||||
|
||||
DocumentRoot /home/dany/www/schubertdaniel
|
||||
DirectoryIndex index.php index.html
|
||||
|
||||
CustomLog /home/dany/www/log/schubertdaniel.log common
|
||||
|
||||
Header set Content-Language: de
|
||||
|
||||
<Directory /home/dany/www/schubertdaniel>
|
||||
AllowOverride All # ermöglicht .htaccess
|
||||
Require all granted # öffentlich zugänglich
|
||||
Options -Indexes # kein Inhaltslisting
|
||||
</Directory>
|
||||
|
||||
</VirtualHost>
|
34
beispiele/15/wp-backup.sh
Normal file
34
beispiele/15/wp-backup.sh
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
function db_backup {
|
||||
|
||||
# Vars
|
||||
host=localhost
|
||||
user=XXXXXXX
|
||||
pass=XXXXXXX
|
||||
db=wordpress
|
||||
|
||||
echo 'DB Export ------> '
|
||||
mysqldump --opt --add-drop-table -h$host -u$user -p$pass $db | gzip > wp-db.sql.gz
|
||||
}
|
||||
|
||||
function file_backup {
|
||||
backupfile="wordpress-backup.tar"
|
||||
|
||||
echo 'File Backup --- building tar File...'
|
||||
tar -cf $backupfile ~/wp*
|
||||
echo '+DONE'
|
||||
}
|
||||
|
||||
|
||||
echo '-------------------------------------------'
|
||||
echo 'Tolles Backup Script'
|
||||
echo '-------------------------------------------'
|
||||
|
||||
backupdir=backup
|
||||
|
||||
cd ~ ; mkdir $backupdir && cd $backupdir || { echo "FEHLER!!!!"; exit 1 }
|
||||
|
||||
# Funktionsaufrufe
|
||||
db_backup
|
||||
file_backup
|
91
beispiele/17/borg-www-backup.rb
Normal file
91
beispiele/17/borg-www-backup.rb
Normal file
@@ -0,0 +1,91 @@
|
||||
#!/usr/bin/env ruby
|
||||
require "date"
|
||||
require "fileutils"
|
||||
|
||||
$NOW = Date.today.strftime("%d-%m-%Y_%H:%M:%S")
|
||||
|
||||
# borg repository
|
||||
$REPO = "/home/dany/backups/borg"
|
||||
|
||||
# websites folder
|
||||
$WEBSITESDIR = "/home/dany/www"
|
||||
|
||||
# local backup folder for db files
|
||||
$BACKUPDIR = "/home/dany/backups"
|
||||
|
||||
unless File.exist?( $BACKUPDIR )
|
||||
FileUtils.mkdir_p( $BACKUPDIR )
|
||||
end
|
||||
|
||||
|
||||
# Unterverzeichnisse von www die gebackuppt werden sollen
|
||||
liste = [
|
||||
"conf",
|
||||
"danletard.de",
|
||||
"papier-restaurierung",
|
||||
"schubertdaniel",
|
||||
"x2ero",
|
||||
"conworx",
|
||||
"rvv/wp-content",
|
||||
"rvv/shop"
|
||||
]
|
||||
|
||||
|
||||
# websites
|
||||
def websites( liste )
|
||||
Dir.chdir( $WEBSITESDIR )
|
||||
|
||||
liste.each do |elem|
|
||||
if File.exist?( elem )
|
||||
`borg create -C zlib,8 #{$REPO}::#{elem}-{now:%d-%m-%Y_%H:%M:%S} #{elem} --exclude '*mpeg'`
|
||||
|
||||
else
|
||||
puts "File or Directory \"#{elem}\" not found!\n"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# davical db backup
|
||||
def calendar_db_backup
|
||||
Dir.chdir( $BACKUPDIR )
|
||||
`pg_dump -U davical_app davical | gzip > kalender-#{$NOW}.psql.gz`
|
||||
end
|
||||
|
||||
# wordpress db backup
|
||||
def wp_db_backup
|
||||
host= "localhost"
|
||||
user= "rvv"
|
||||
pass= "owUy9JTWLHQ0"
|
||||
#db= "rvv0rettung"
|
||||
db= "rvv_dev"
|
||||
|
||||
do_sql_backup(host,user,pass,db)
|
||||
end
|
||||
|
||||
# oxid db backup
|
||||
def oxid_db_backup
|
||||
host= "localhost"
|
||||
user= "rvv"
|
||||
pass= "owUy9JTWLHQ0"
|
||||
db= "rvv_shop"
|
||||
|
||||
do_sql_backup(host,user,pass,db)
|
||||
end
|
||||
|
||||
#
|
||||
# Helper function
|
||||
#
|
||||
def do_sql_backup(host,user,pass,db)
|
||||
Dir.chdir( $BACKUPDIR )
|
||||
`mysqldump --opt --add-drop-table -h#{host} -u#{user} -p#{pass} #{db} | gzip > #{db}-#{$NOW}.sql.gz`
|
||||
end
|
||||
|
||||
websites( liste )
|
||||
wp_db_backup
|
||||
oxid_db_backup
|
||||
calendar_db_backup
|
||||
|
||||
FileUtils.chown_R( 1000, 1000, $BACKUPDIR)
|
||||
|
||||
|
34
beispiele/17/wp-backup.sh
Normal file
34
beispiele/17/wp-backup.sh
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
function db_backup {
|
||||
|
||||
# Vars
|
||||
host=localhost
|
||||
user=XXXXXXX
|
||||
pass=XXXXXXX
|
||||
db=wordpress
|
||||
|
||||
echo 'DB Export ------> '
|
||||
mysqldump --opt --add-drop-table -h$host -u$user -p$pass $db | gzip > wp-db.sql.gz
|
||||
}
|
||||
|
||||
function file_backup {
|
||||
backupfile="wordpress-backup.tar"
|
||||
|
||||
echo 'File Backup --- building tar File...'
|
||||
tar -cf $backupfile ~/wp*
|
||||
echo '+DONE'
|
||||
}
|
||||
|
||||
|
||||
echo '-------------------------------------------'
|
||||
echo 'Tolles Backup Script'
|
||||
echo '-------------------------------------------'
|
||||
|
||||
backupdir=backup
|
||||
|
||||
cd ~ ; mkdir $backupdir && cd $backupdir || { echo "FEHLER!!!!"; exit 1 }
|
||||
|
||||
# Funktionsaufrufe
|
||||
db_backup
|
||||
file_backup
|
Reference in New Issue
Block a user