Skip to content
Snippets Groups Projects
Commit 241fa2ff authored by efer's avatar efer
Browse files

add serial file

parent 1c6f8260
No related branches found
No related tags found
No related merge requests found
......@@ -13,10 +13,11 @@
# Main Variables
SCRIPTNAME="comp-backup"
VERSION=6
VERSION=7
LOGNAME="backup_logfile"
TARGETNODE="backup.compute.dtu.dk"
HOST=$(hostname -s)
SERIAL=/etc/dtuserial
H=$HOME
BIN_DIR="$H/bin"
......@@ -202,6 +203,11 @@ if [ $? = 0 ]; then
else
ssh -i $SSHKEY $RUSER@$TARGETNODE "mkdir $RHOME/$HOST && chmod 700 $RHOME/$HOST"
if [ $? = 0 ]; then
if [ -f "$SERIAL" ]; then
scp -i $SSHKEY $SERIAL $RHOME/$HOST/ &>/dev/null
else
echo "No Serial file to copy..."
fi
echo "Created backup dir"
else
echo "Failed to create backup dir"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment