Floppy to Floppy copy with only one drive

Floppy to Floppy Copy with only one drive

#!/bin/sh
#Floppy to floppy copy with only one floppy drive
#Copy this script to a file and give it a name eg. floppycopy
#Make it executable with the command :- chmod +x floppycopy
#Usage
#In a terminal,
#cd to the directory containing floppycopy, su to root, and type ./floppycopy
#insert the disk to be copied when asked, and press enter
#insert the disk to be copied to when asked, and press enter
#remove disk when ‘disk copied’ message appears

#clear the terminal

clear

#warn user

echo “This command will delete all files on the target disk before copying!!!”

#prompt user to insert source disk

echo -n “Insert source disk and hit …return”

read Response

mount /dev/fd0 /mnt/floppy #mount target disk

dd if=/dev/fd0 of=diskcopy.swp #copy contents of source to swap

umount /mnt/floppy #prepare for switching of disks

echo “WARNING!!!! All files currently on target disk will be deleted!”

echo -n “Insert target disk and hit …” #prompt user to switch disks

read Response

mount /dev/fd0 /mnt/floppy #mount target disk

rm -rf /mnt/floppy/* #remove any files on target

dd if=diskcopy.swp of=/dev/fd0 #copy files from swap to target

rm -rf diskcopy.swp #remove swap file

umount /mnt/floppy

echo “Disk copied.”

exit

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s