CyberTek - the future at the present!
Google

Script to backup to dvd

Posted by: admin (Aug 29)

The following script is made a backup of some folders on dvd burn through, after a report is sent via email to the address. It is used M-mode (append) Asthe the-Z if started in a non-interactive does not work properly in the presence of data on the media, you can try using cmq growisofs-use-the-force-luke = tty-Z even in non-interactive mode while having the data already on the media.

Example:

Create a file and make it executable:

> Touch / bin / dvdbackup.sh

> Chmod 755 / bin / dvdbackup.sh

Add the following instructions:

#! / bin / bash
# Replace the hiring of the program with those of your operating system
Growisofs = / usr / bin / growisofs
ECHO = / bin / echo
GREP = / bin / grep
MAIL = / bin / mail
today = `/ bin / date +% A`
# Backup begins below
$ ECHO "Creating $ backup today">> / tmp / backupoutput.tmp
$ ECHO>> / tmp / backupoutput.tmp
$ Growisofs-use-the-force-luke = tty-dvd-compat-M / dev / dvd-D-J-R-T-l
-graft-points-joliet-long-hide-joliet-trans-tbl
-iso-level 4-speed = 1-overburn-V "$ today Backup"
etc / mail = / etc / mail
var / spool / mail = / var / spool / mail
home = / home
root = / root>> / tmp / backupoutput.tmp 2> & 1
# Edit paths rescue here above as needed
mycode = $?
$ ECHO>> / tmp / backupoutput.tmp
$ ECHO "An error occurred, error code: $ mycode">> / tmp / backupoutput.tmp
$ ECHO>> / tmp / backupoutput.tmp
$ ECHO "End of today $ backup">> / tmp / backupoutput.tmp
$ GREP-i-v sleeping / tmp / backupoutput.tmp> / tmp/backupoutput.tmp2
$ GREP-i-v formatting / tmp/backupoutput.tmp2> / tmp / backupoutput.txt
$ MAIL-s-n "result of the backup to DVD" usermail @ domain </ tmp / backupoutput.txt

In crontab then simply add the schedule to start in invoking the backup:

> Crontab-e

Example line to be added:

0 20 * * * / bin / dvdbackup.sh

Published in: development, scripts, tips

Add A Comment

Powered by CyberTek - Remote Assistance