I-Appliance BBS
The Official Source for Internet Appliance Upgrades and Mods

Click Here!
BBS Main List | Sign In | Sign Up | Search | Help | Linux-Hacker.netReply to Thread | Printer |

Home / Other I-Appliances / 3Com Audrey
Batch Processing
Newbee Question

New MessageBatch Processing (modified 0 times) davistw1
Profile
Does *NIX have a batch file capability? I would like to setup a batch file to:
Mount my windows filesystem if not already mounted and backup my Audrey image to it..
I know I can do it with 2 commands and have done it but can I put them in a batch and just execute the one command to run the batch?
02-23-2002 16:23:23

New MessageRE:Batch Processing (modified 0 times) booya
Profile
Create a file with your commands.. then
#sh FILENAME

that will execute each line of the file.

02-23-2002 17:45:19

New MessageRE:Batch Processing (modified 0 times) davistw1
Profile
Cool, do I have to put the file in any "special" place to get global access? I put it in /nto/bin and I still have to cd to /nto/bin in order to execute it..
02-23-2002 18:01:12

New MessageRE:Batch Processing (modified 0 times) davistw1
Profile
One more question. Where can I go to get more information on the .sh programming language? I assume it is like dos batch in that it has if then conditionals etc...
02-24-2002 07:14:42

New MessageRE:Batch Processing (modified 0 times) keith721
Profile
try any of the available books on the UNIX Bourne shell, or the Linux BASH (Bourne-again shell). i prefer the O'Reilly series of books. they're small, light, and very good references.

keith721

02-24-2002 08:26:25

New MessageRE:Batch Processing (modified 0 times) jhd3rd
Profile
Just a couple of tips for shell script newbies ...

You can make a script executable so that you don't have to use sh to run it. In otherwords, you can just type "myscript" instead of "sh myscript". This also allows you to drop the script into any directory in your path and run it with a single command.

First, make the first line of your script (type it exactly as follows):

#!/bin/sh

Once your script is created, make it executable:

chmod a+x myscript

Thats it. Have fun. BTW, you don't need to run out to the bookstore to get more information, just go to Yahoo and search for "bash shell tutorial", there should be plenty to get you started.

02-24-2002 09:03:13

New MessageRE:Batch Processing (modified 0 times) davistw1
Profile
Just too cool!!!!!
02-24-2002 14:54:23

New MessageMy First Script (modified 0 times) davistw1
Profile
I wrote my first script... It mounts my windows share. I have a hard time remembering the fs-cifs command structure so I wrote this. I called it mountwin and using the trick above put in in the /nto/bin director and made it executeable. Now when I reboot my audrey all I have to do is execute the command mountwin...


#!/bin/sh
#
# See if it is already mounted and exit if so
#
if test -d /windows
then
echo "Windows share already mounted"; exit
else
#
# Mount it and exit
#
echo "Mounting Windows share"
fs-cifs -av //MyComputername:192.168.X.X:/MySharename /windows UNAME UPWD
echo /windows mounted
fi

02-24-2002 15:19:33

New MessageScript to backup audrey (modified 0 times) davistw1
Profile
Here is a script file to automate the backup process to an windows share
It backups to /windows/backup/BackupDDMMYYYY_HHMMSS...
I use it just before I do something I think may go wrong to have a backup just in case...

#!/bin/sh
#
# Create Backup Filename
#
BackupFileName=/windows/backup/Backup_$(date +%m%d%Y_%H%M%S)
echo "Backing up audrey to $BackupFileName please wait"
cat /dev/fs0p0 /dev/fs0p1 > $BackupFileName
echo "Backup Completed"

02-24-2002 18:56:57

Reply to Thread | Printer |
All times are PSTPowered by UltraBoard v1.62



Copyright © 2000, Netmake Inc. All Rights Reserved.
See Terms and Conditions for more information.




i-opener opener laptop notebook computer help drivers dll free windows dos repair fix linux mac macintosh 2000 95 98 nt pc configure hardware software sound video netscape explorer network networking lan wan software cmos fat bios printer card mouse modem ide scsi cd rom controllers scanner tape hard drive cgi scripts source code mp3