-
Help with a script
hey.. pretty new to knoppix and i have to write a little script for my class. I am booting off the knoppix cd on my laptop.
Script project: To take pics from multiple floppy disks, and burn them to a cd.
I can picture the script in my head, but tell me if im on the right track.
I would need to first have the script ask user to insert floppy, then read it somehow, then save it in a temporary file.
Ask if user has another floppy, insert, read, save to temp. file. [repeat until user says No more floppies]
then take that temp file and burn it to cd
then delete the temp file as i wouldnt need it anymore
Question is, what command would i use to pull the files from the floppy?
And also.. im going to be using an external usb cd burner, will it work? and how would i point to the burner to burn the pics?
Thanks, if any more info is needed, just tell me.. im a noob ![Confused](images/smilies/icon_confused.gif)
I'm not looking for the script written for me.. just some basic tools and commands i could use..
-
Senior Member
registered user
Re: Help with a script
1st you have to mount the floppy ( mount /dev/fd0 /mnt/floppy ) and then use ' cp ' to copy the files (' man cp '). DON'T FORGET to umount the floppy drive before asking for another disk.
' cdrecord -scanbus ' should detect your burner, use ' man cdrecord ' for more help. And BTW, you are better off storing the copied files in a temp *directory*, not a file. ![Wink](images/smilies/icon_wink.gif)
--Best of luck w/ your assignment.
![Quote](images/misc/quote_icon.png)
Originally Posted by
lindros
hey.. pretty new to knoppix and i have to write a little script for my class. I am booting off the knoppix cd on my laptop.
Script project: To take pics from multiple floppy disks, and burn them to a cd.
I can picture the script in my head, but tell me if im on the right track.
I would need to first have the script ask user to insert floppy, then read it somehow, then save it in a temporary file.
Ask if user has another floppy, insert, read, save to temp. file. [repeat until user says No more floppies]
then take that temp file and burn it to cd
then delete the temp file as i wouldnt need it anymore
Question is, what command would i use to pull the files from the floppy?
And also.. im going to be using an external usb cd burner, will it work? and how would i point to the burner to burn the pics?
Thanks, if any more info is needed, just tell me.. im a noob
![Confused](images/smilies/icon_confused.gif)
I'm not looking for the script written for me.. just some basic tools and commands i could use..
-
thanks man, that is some of the info i was looking for right now. I know the structure of the script in my head, just need/needed some commands and such like you provided, especially the directory insted of a file
, didnt even think about that. Thanks again, I will ask if i run into any problems.
-
how come when i try to mount the floppy drive.. it says that it is already mounted?
Part of script:
echo insert floppy and press enter...
read var
mkdir tempfloppy
mount /dev/fd0
cp /dev/fd0 tempfloppy
umount /dev/fd0
Should it be this?
echo insert floppy and press enter...
read var
mkdir tempfloppy
cd tempfloppy
mount /dev/fd0
cp /dev/fd0 tempfloppy
umount /dev/fd0
im basically having troubles mounting the floppy... and is that the right command to copy the contents of the floppy disk to the tempfloppy directory?
Thanks... uber noob here
-
Junior Member
registered user
When using mount, you have to mount a device to a directory in order to access this file. here's an example:
mkdir /mnt/floppy (it should laready be created though)
mkdir /tmp/fl2cd
mount /dev/fd0 /mnt/floppy
cp /mnt/floppy/*.* /tmp/fl2cd
...
(You get the point)
BTW, is this for a college course?
-
OK guys,
after some testing with other operatingsystems (hpux) I have found out, the problem resides on the serverside.
I've checked the ftpd-manualpage:
...
Ftpd authenticates users according to five rules.
...
3. The user must have a standard shell
BINGO!
After adding /bin/bash everything works fine with ftp.
bad joke caused by command
"useradd username"
on the serverside kx-2003-06-06 (ftpd).
This command was used by me for configuring my "non-root"-user after knoppix-install.
The sideeffekt of the above command is, the added user has no shellentry in the passwd and ftpd exits with
"login incorrect"
It's really simple!
What I didn't understood is, why "ftpd -d" doesn't report the cause for failure - in this case "no shell entry in the passwd"???
-
Junior Member
registered user
Are you sure this is the right post?
-
Senior Member
registered user
Hello lindros
When you get to the part of the script to burn
the files onto a cd look at the scripts I have
posted to burn_home. My project is very
preliminary but this may give you some
http://www.knoppix.net/forum/viewtopic.php?t=2705
you will need
cdrecord -scanbus (to get dev=?,?,? to define your burner location)
cdrecord
mkisofs (for long file name support add after mkisofs
-joliet-long yes no space in that option)
and most fun of all
eject cdrom1 (my cd burner is the second cd so it's cdrom1)
for the thrill of seeing it pop out when all is done.
Best Wishes
paradocs
edit 1 made the link url tag.
edit 2 fixed typo burn
-
here is the final script that i wrote:
#!/bin/bash
killall automount
echo Insert floppy and press Enter to continue…
read var
mkdir tempfloppy
mount /mnt/auto/floppy
cp /mnt/auto/floppy/*.* tempfloppy
umount /mnt/auto/floppy
continue=y
while [ “$continue” == y –o “$continue” = Y];do
mount /mnt/auto/floppy
cp /mnt/auto/floppy/*.* tempfloppy
umount /mnt/auto/floppy
echo “Do you have another floppy (y/n)?”
read continue
done
mkisofs –R –J –l –o pics.img tempfloppy
cdrecord –eject –v speed=2 dev=1,0,0 pics.img
it works good and the reason i wrote this was to either back up floppies i have laying around, and my digi came saves to floppy discs, so now i can burn them to a cd when i get enough (easier to carry around one cd then a stack of floppy disks.)
-
Senior Member
registered user
Hi lindros,
Good work. I may even use your script.
I so happens that I have taken over
6,000 photos on floppies with a Mavaca
fd91 camera. Perhaps yours is similar.
Did you know that KNOPPIX even has a
program for the camera called 411toppm ?
KNOPPIX sure beats M$ with scripting
tools for the motavated user. You
don't have to wait for some program
to come along to purchase.
Best Wishes
paradocs
Similar Threads
-
By jehan60188 in forum MS Windows & New to Linux
Replies: 1
Last Post: 05-25-2005, 08:40 PM
-
By digDug in forum General Support
Replies: 5
Last Post: 01-14-2005, 11:50 AM
-
By bob58 in forum General Support
Replies: 24
Last Post: 10-13-2004, 10:08 PM
-
By orcslayer in forum General Support
Replies: 1
Last Post: 01-03-2004, 02:04 AM
-
By punk000 in forum General Support
Replies: 3
Last Post: 02-26-2003, 07:02 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
![DELL PowerEdge R730XD Server 2x E5-2690v4 2.6GHz =28 Cores 64GB H730 4xRJ45 picture](/store/img/g/psQAAOSwaY9ki5PI/s-l225/DELL-PowerEdge-R730XD-Server-2x-E5-2690v4-2-6GHz-2.jpg)
DELL PowerEdge R730XD Server 2x E5-2690v4 2.6GHz =28 Cores 64GB H730 4xRJ45
$387.00
![DELL R630 SERVER 8 x 2.5'' 2X E5-2680V4 32GB RAM IDRAC ENT & NDC 2X 495W PSU picture](/store/img/g/mkkAAOSwE5ZmT1Cg/s-l225/DELL-R630-SERVER-8-x-2-5-2X-E5-2680V4-32GB-RAM-IDR.jpg)
DELL R630 SERVER 8 x 2.5'' 2X E5-2680V4 32GB RAM IDRAC ENT & NDC 2X 495W PSU
$169.95
![Dell PowerEdge R630 Server 2x E5-2640v3 2.60Ghz 16-Core 64GB H330 picture](/store/img/g/ZD0AAOSwm41mOZYw/s-l225/Dell-PowerEdge-R630-Server-2x-E5-2640v3-2-60Ghz-16.jpg)
Dell PowerEdge R630 Server 2x E5-2640v3 2.60Ghz 16-Core 64GB H330
$182.65
![Dell Poweredge R210 Server X3450 2.67GHz 8GB RAM - NO HDDs picture](/store/img/g/wWcAAOSw3B5mcJsj/s-l225/Dell-Poweredge-R210-Server-X3450-2-67GHz-8GB-RAM-N.jpg)
Dell Poweredge R210 Server X3450 2.67GHz 8GB RAM - NO HDDs
$59.99
![Dell PowerEdge R730XD 28 Core Server 2X Xeon E5-2680 V4 H730 128GB RAM No HDD picture](/store/img/g/QTAAAOSwrO9l4PEx/s-l225/Dell-PowerEdge-R730XD-28-Core-Server-2X-Xeon-E5-26.jpg)
Dell PowerEdge R730XD 28 Core Server 2X Xeon E5-2680 V4 H730 128GB RAM No HDD
$389.99
![Dell Poweredge R730xd 12 Bay LFF 2x SFF 2x E5-2680v3 2.5ghz H730p No Ram No HDD picture](/store/img/g/JzAAAOSwxLZmKS26/s-l225/Dell-Poweredge-R730xd-12-Bay-LFF-2x-SFF-2x-E5-2680.jpg)
Dell Poweredge R730xd 12 Bay LFF 2x SFF 2x E5-2680v3 2.5ghz H730p No Ram No HDD
$219.99
![Dell PowerEdge R620 Server - 256GB RAM, 2x8cCPU, 120Gb SSD/3x900Gb SAS, Proxmox picture](/store/img/g/480AAOSw9TVl9vAv/s-l225/Dell-PowerEdge-R620-Server-256GB-RAM-2x8cCPU-120Gb.jpg)
Dell PowerEdge R620 Server - 256GB RAM, 2x8cCPU, 120Gb SSD/3x900Gb SAS, Proxmox
$320.00
![Dell R730xd 26 Port SFF 2x E5-2697v4 36-Cores H730 128GB Server 2x SFP 10G ENT picture](/store/img/g/Gp4AAOSwen9mAyUo/s-l225/Dell-R730xd-26-Port-SFF-2x-E5-2697v4-36-Cores-H730.jpg)
Dell R730xd 26 Port SFF 2x E5-2697v4 36-Cores H730 128GB Server 2x SFP 10G ENT
$490.00
![Dell Poweredge R630 Server 2x E5-2620 V4 =16 Cores | S130 | 32GB RAM | 2x trays picture](/store/img/g/GAcAAOSw9Q1mGSZW/s-l225/Dell-Poweredge-R630-Server-2x-E5-2620-V4-16-Cores-.jpg)
Dell Poweredge R630 Server 2x E5-2620 V4 =16 Cores | S130 | 32GB RAM | 2x trays
$153.99
![DELL PowerEdge R630 8SFF Server 2x E5-2690v4 2.6GHz =28 Cores 256GB H730 4xRJ45 picture](/store/img/g/qfQAAOSw9XRklkNR/s-l225/DELL-PowerEdge-R630-8SFF-Server-2x-E5-2690v4-2-6GH.jpg)
DELL PowerEdge R630 8SFF Server 2x E5-2690v4 2.6GHz =28 Cores 256GB H730 4xRJ45
$562.00