Begin Övning 5
This commit is contained in:
parent
a0adf95d86
commit
213a227166
29
Labb5/ovning5.sh
Executable file
29
Labb5/ovning5.sh
Executable file
@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
#Jack-Benny Persson
|
||||
# LX13
|
||||
# Övning 5, labb 5
|
||||
# Backup-script
|
||||
|
||||
# Sanity checks
|
||||
|
||||
# Set some variabels
|
||||
BackupTo="$HOME/backups/"
|
||||
|
||||
# Sanity checks
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: $0 <directory>"
|
||||
fi
|
||||
|
||||
if [ -w $BackupTo ]; then
|
||||
echo "Can't write to $BackupTo" > /dev/stderr
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ ! -r "$1" ]; then
|
||||
echo "Can't read $1"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Main
|
||||
|
Loading…
x
Reference in New Issue
Block a user