All pastes #135090 Raw Edit

Miscellany

public text v1 · immutable
#135090 ·published 2006-08-16 18:04 UTC
rendered paste body
#!/bin/bash

echo "what directory are we backing up (use * for pwd)?"
read source

while ["$tar" != "y"] || [ "$tar" != "n"]
do
        echo "are we creating a tar (y/n)?"
        read tar
done

echo "where are we putting the backup?"
read dest

echo $source
echo $tar
echo $dest

if [$tar="y" || $tar="yes"]
then
        echo "what are we calling the tar file?"
        read tarName
        echo "will now tar..."
        tar -cvvf $tarName $source
        mv $tarName $dest
        exit 0

else if [$tar!= "yes" || "y"]
then
        rsync -tr $source/* $dest/
        exit 0

else
        echo "some nasty error has occured"
        exit 0
fi

echo "you should never see this"
exit 0