You are here

Home

Backup script

Az alábbi backup scriptet használom VPS en, cronba időzitve. Az előző bakcupot törli , majd emailban elküldi a LOGot csatolva.
Ellenőrzés nincs benne.

#!/bin/sh

DIR=/home/USER/Backup/
FILENAME=USERALLOKbackup`date '+%d-%B-%Y'`

cd $DIR
rm *.tgz

echo $DIR$FILENAME.txt

tar cvpzf $DIR$FILENAME.tgz --ignore-failed-read --exclude=/proc --exclude=/lost+found --exclude=/dev --exclude=/mnt --exclude=/sys --exclude=/home/USER/Backup --exclude=/var/run --exclude=/var/lib/apache2 --exclude=/var/spool / | xargs ls -lah > $DIR$FILENAME.txt

mail -a $DIR$FILENAME.txt -s "Backup finished - LOG $(date)" email@kiszolgalo.hu

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Powered by Drupal

User login