Here the code:
#!/bin/sh # scimanse.sh # author....: Muratore Alessandro # email.....: muratore.ale@gmail.com # project...: studies related to shell scripting # title.....: simple backup dir with tar and date inclusion # bck_date="backup-%(date '+%d-%m-%y').tar.gz" # setting up the name of your backup with # date inclusion dir_data="/var/www/apache/htdconf" # dir where you have files for backuping dir_bck="/mnt/pendrive" # setting up pendrive device for your backup # change /mnt/pendrive with /cdrom or # /home/backup or what you want. echo " Starting compression and backup of $dir_data..." tar zcvf $dir_bck/$bck_date $dir_data echo " Finish compression and backup of $dir_data." echo "You can find your backup: $dir_bck."
Nessun commento:
Posta un commento