I developed a bash backup script for my home network that works pretty well, and I learned a lot in the process. I'm having trouble using a variable in a path however. I want to prepend the date to an mbr backup. This code works
Code:
ssh ws-mint dd if=/dev/sda of=$MBR_path/sda/"`date +%m-%d-%Y-%R`"_xps-mbr-sda-512.img bs=512 count=1 > /dev/null 2>&1 &&
But I would like to use this:
Code:
# Variables
TODAY="`date +%m-%d-%Y-%R`"
ssh ws-mint dd if=/dev/sda of=$MBR_path/sda/$TODAY_xps-mbr-sda-512.img bs=512 count=1 > /dev/null 2>&1 &&
But this doesn't work. Neither does any combination of /\$TODAY\ or quotes etc. I googled this, but kept getting PATH_ENV and related. I could leave it as is, but I'd like to know how to do this. thx, feffer777