Simple Linux Backup Script

/ linux

The code of your backup_script.sh script will be the following:

#!/bin/bash
BACKUPTIME=`date +%b-%d-%y` #get the current date
DESTINATION=/backup/dest/backup-$BACKUPTIME.tar.gz #create a backup file using the current date in it's name
SOURCEFOLDER=/data/src #the folder that contains the files that we want to backup
tar -cpzf $DESTINATION $SOURCEFOLDER #create the backup

Next Post Previous Post