Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
- The problem statement, all variables and given/known data:
My work is to write or design a script in bash shell script format for the Linux O/S Debian distro "Knoppix 6.7".
What the script needs to do is basically delete temporary files and back up data from one directory/folder to another designated Backup.
-
Relevant commands, code, scripts, algorithms:
-
The attempts at a solution (include all code and scripts):
#!/bin/bash
#This script will automatically delete temporary files
rm -rf /tmp/*
rm -rf/var/tmp/*
fsck -A
exit
#! /bin/bash
# Variables
location=/home/veiset
directory=Documents
backuplocation=/media/veiset/backup
log=~/backup.log
echo -e �\nBackup started: `date`� >> $log
if [ -d $backuplocation ]; then
mkdir -p $backuplocation/`date +%y%m%d`
cd $location
tar -cvvf $backuplocation/`date +%y%m%d`/data.`date +%H%M%S`.tar.gz $directory
echo � completed: `date`� >> $log
cp $log $backuplocation/backup.log
echo -e �\n � Backup completed �\n�;
else
echo � FAILED: `date`� >> $log
echo -e �\n� WARNING: ��
echo -e �� BACKUP FAILED �\n�;
fi
exit
I'm not too sure on what else to do, and if I am doing it right!?
- Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
wanstead sixth form
london
england