|
I use a small script to backup my files to the flash disk. Some flash disks when mounted automatically have a space in the path (/media/USB DISK for example).
My script works when there is no space but fails when there is a space.
I read about symbolic links, and tried to create one in the bash script without success.
Here is my script which works with a KINGSTON flash disk...
(I transfer my python source code to/from the office on my flash disk each day using this script.)
echo '------------------------------' echo ' 1. Send to flash disk' echo ' 2. Update from flash disk' echo '------------------------------' echo -e 'Selection (1,2): \c' read sel if [ $sel = '1' ]; then source='/home/xpData/programing/' target='/media/KINGSTON/programing/' else source='/media/KINGSTON/programing/' target='/home/xpData/programing/' fi
echo $source echo $target
rsync -nuvr --exclude-from=excluded_files $source $target
echo -e 'Continue (y/n): \c' read ans
if [ $ans = 'y' ]; then echo 'Updating' rsync -tur --exclude-from=excluded_files $source $target else echo 'Cancelled' fi
|