Koopiate tegemise scriptid

# Where to backup to.
dest=”/mnt/koopia/helia/web_vana/” – siia reale kirjutada koht kuhu soov on koopia teha

# What to backup.
backup_files=”/var/www/html/” – siia reale kirjutada koht millest koopia teha

########################

#!/bin/sh
####################################
#
# Backup to NFS mount script.
#
####################################

# What to backup.
backup_files=”/var/www/html/”

# Where to backup to.
dest=”/mnt/koopia/helia/web_vana/”

# Create archive filename.
day=$(date +%Y-%m-%d_%Hh-%Mm)
hostname=$(hostname -s)
archive_file=”$hostname-$day.tgz”

# Print start status message.
echo “Backing up $backup_files to $dest/$archive_file”
date
echo

# Backup the files using tar.
tar czf $dest/$archive_file $backup_files

# Print end status message.
echo
echo “Backup finished”
date

# Long listing of files in $dest to check file sizes.
ls -lh $dest