Skip to main content

Bash script: sync a USB drive

If you want to sync certain directories from your computer to a removable drive (USB flash drive or external hard drive), use this Bash script as a starting point and modify it:


# set variable for USB drive
# set variable for podcast list file
# set variable for temp directory
# set variable for scripts directory
# set variable for encrypted file
# set variable for local directory to backup USB drive to
# set variable for files directory on USBDRIVE

# sync PODCASTLIST to USB drive
# rsync --verbose --recursive --update --delete --progress $PODCASTLIST $FILESDIR
# sync TEMPDIR to USB drive
rsync --verbose --recursive --update --delete --progress $TEMPDIR ${FILESDIR}temp
# sync SCRIPTSDIR to USB drive
rsync --verbose --recursive --update --delete --progress $SCRIPTSDIR ${FILESDIR}auto

rsync --verbose --recursive --update --delete --progress $USBDRIVE $USBBACKUPDIR

# unmount USB drive if desired
echo "Unmount? y/n"
if [ "$ANSWER" = "y" ]; then
sudo umount $USBDRIVE
echo "$USBDRIVE unmounted!"
echo "$USBDRIVE still mounted!"


Popular posts from this blog

The difference between burritos, chimichangas, and enchiladas

I love Mexican food, but I'm embarrassed to admit that I always get confused between burritos, wet burritos, chimichangas, and enchiladas. Here are the descriptions, with the differences in bold and pictures following each description.

A flour tortilla wrapped around a filling (meat, beans, vegetables, etc)

wet burrito
A burrito that's covered in red chili sauce and cheese. Because of the sauce covering, it looks like an enchilada, but it's made with a flour tortilla, whereas the enchilada is made with a corn tortilla.

A burrito that's deep-fried. Sometimes covered with cheese or another topping.

A corn tortilla wrapped around a filling, covered with chili pepper sauce

Wikipedia: BurritoWikipedia: ChimichangaWikipedia: Enchilada

Edit scanned documents with Word 2007

Office 2007 includes support for converting scanned documents to editable text using OCR (optical character recognition). To get your text from a paper document to Word 2007:
In the Control Panel, open Add or Remove Programs.Find Microsoft Office, click it, and click Change.In the Office Installation Options window, expand Office Tools, click Microsoft Office Document Imaging, and select Run from My Computer from the dropdown.Click Continue or Next until you reach the end.You can now scan documents and convert the scanned images to editable text:
From the Start Menu, find Microsoft Office, then select Microsoft Office Tools, then click Microsoft Office Document Scanning.Choose your preset and options, then click Scan.The scanned image should open in Microsoft Office Document Imaging. To perform OCR and open the editable text in Word, click Tools, Send Text to Word.You can now edit and save the scanned document as a Word document.

Considering retiring this blog

I'm seriously considering retiring this blog. When I started it in 2008, it was a place for me to share thoughts and links on a variety of topics. For at least the last year, however, it's just been a place where I re-post book reviews from Goodreads.

You can see all my book reviews on my Goodreads profile, and subscribe to my Goodreads RSS feed to be notified of new reviews. I also intend to keep blogging about WordPress, web design, and web-related topics on my OptimWise blog, which also has an RSS feed.

Would you miss this blog if I discontinued it? Please leave a comment.