Hello Ubuntu forums!
I am new to Ubuntu, and so far have done several things I am quite proud of:
- Made an apache webserver with my own html (before a week ago I had never touched it)
- Made a stratum mining server +titcoin node
And my latest project is making a shell script to backup my ENTIRE (that’s right) hard drive to a huge external one. Getting to the point, I know there’s quite a bit I could improve on, and I would like your opinion on it:
read -n1 -p “Would you like to back up your system? Uno for Si, and Dos for No.” input
case $input in
1) fdisk -l;
read -p “Please enter the name of your backup disk that was displayed in the fdisk window: ” disk ;
echo “Backups now in progress! Please be aware that backups are saved to a Backups directory which this script creates, and backups are tarred and labelled by date!”;
echo “THIS WILL TAKE A VERY VERY LONG TIME IF YOU HAVE A LARGE FILESYSTEM! PLEASE BE PATIENT!!!”;
sudo mkdir -p /mnt/$disk && sudo mount /dev/$disk /mnt/$disk && sudo mkdir -p /mnt/$disk/Backups && sudo tar -cp $(date +%Y%m%d).tar --directory=/ --exclude=proc --exclude=sys --exclude=dev/pts --exclude=backups . && sudo cp $(date +%Y%m%d-%H).tar /mnt/$disk/Backups;
echo “Okay, all done! To restore your system, you will have to untar and manually do it yourself. If you have any issues, email firstname.lastname@example.org!”;;
2) echo “Then why are you running this script?”;;
*) echo “I'm sorry, but I can’t do that…”
Honestly, I have no idea what I am doing. Any suggestions?