Backup Script Linux

Tutorialdetails

Tutorial: Backup Script Linux
Autor PsyCore
Version 1.0
Quelle hier klicken
Kommentar ins Gästebuch schreiben

Besuche uns auf facebook.com und erhalte immer aktuelle Hilfestellungen, Anleitungen und Infos!

Daten Kollektor

#!/bin/sh
# Remote Server Backup Script v0.5a by PsyCore
 
# vars
 
	BCF=servername.backup.tar
 
	FTPHost=srv.backup.ip
	FTPPort=21
	FTPUser=FTPUser
	FTPPass=FTPPass
 
	SQLUser=root
	SQLPass=SQLPASS
 
	SUBJECT="Servername Backup Status"
	EMAIL="operations@admin.ip"
	EMSG="/tmp/emsg.txt"
 
# dumping mySQL tables
 
	mysqldump -u $SQLUser -p$SQLPass --all-databases > root_full.sql
 
# collect and compress backup files
 
	tar cvfz webs.tgz /var/www/user/dir1 /var/www/user/dir2
	tar cvfz sql.backup.tgz *.sql
 
# archive all
 
	tar cvf $BCF *.tgz
 
# FTP transfer
 
./rftp.sh $FTPHost $FTPPort $FTPUser $FTPPass $BCF
 
# cleanup
 
	rm -f *.sql
	rm -f *.tgz
	rm -f *.tar
 
echo "Backup Status: " >$EMSG
grep "bytes sent" backup.log>>$EMSG
grep "221 Goodbye" backup.log>>$EMSG
 
mail -s "$SUBJECT" "$EMAIL" < $EMSG
rm $EMSG
 
# EOF

Remote FTP Script

#!/bin/sh
# Remote Server Backup Script v0.5a by PsyCore
 
ftp -vn <<EOFTP
open $1 $2
user $3 $4
cd "dir1/subdir/servername"
delete $5
put $5
quit
EOFTP
Drucken/exportieren
QR-Code
QR-Code Backup Script Linux (erstellt für aktuelle Seite)