0% found this document useful (0 votes)
5 views1 page

Bash Backup Script Example

Uploaded by

Gautam Govind
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Bash Backup Script Example

Uploaded by

Gautam Govind
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

[student@serverX -]$ cat hello

#!/bin/bash

echo "Hello, world"

[student@serverX -]$ ./hello Hello, world

Taking Backup Script

#!/bin/bash
#Purpose = Backup of Important Data

DATE=$(date +"%d-%b-%Y")
SRCDIR="/var/www/html"
DESDIR="/media/HDD-01/html"
FILENAME=html-$[Link]

# Making backup with compress


tar -cpzf $DESDIR/$FILENAME $SRCDIR

You might also like