PDA

View Full Version : Shell Scripts -Questions


Gorisan
08-01-2008, 03:05 PM
Ok, well Its not that I haven't tried to find the answers but here we go.

What extension is used for Shell scripts, as in the ones SuperDuper can use?
(in that "other" OS, I used to write simple .bat files)

How does one test scripts from the "file" format.

Is there a 101, for dummies, Introduction for complete Windoze morons for said scripts? ;o)

Applescript is completely different right!?!

I am trying to setup something similar to:

http://www.leancrew.com/all-this/2008/02/superduper-scripts/



Gorisan

jtk
08-01-2008, 07:15 PM
What extension is used for Shell scripts, as in the ones SuperDuper can use?

There is no specific extension for shell scripts, so none is required. However, ".sh" is pretty common and will be recognized.

How does one test scripts from the "file" format.

Not quite sure what you mean by "scripts from the 'file' format," but if you're talking about shell scripts, open the Terminal app (located in Applications->Utilities), make sure the script you want to test is executable (use chmod u+x my-script-name), then execute it from the command line (./my-script-name, assuming it's in your current working directory).

If you're talking about the .dset files, then they're XML files, so they can't be executed directly. Perhaps others can help you determine better how to test them.

Is there a 101, for dummies, Introduction for complete Windoze morons for said scripts? ;o)

Yes, many. Any Linux site will most likely have tutorials on shell scripting (http://www.google.com/search?hl=en&rls=en&q=shell+scripting+tutorial&btnG=Search). Google is your friend. By default, current versions of Mac OS X use the Bourne-Again Shell (bash), so that would be a good place to start. An information-dense but less user-friendly source is the man page (type man bash or man sh in the Terminal app).

Applescript is completely different right!?!

Yes, absolutely correct.

I am trying to setup something similar to [...]

Hmm... May I ask why? Are you trying to set up unattended backups? If so, there is a way to tell the system not to unmount volumes when you log out.

Otherwise, the examples on the page you linked to are pretty straight-forward. You'll just need to copy the text (without the line numbers) of the final version into a file and change the "Backup" (in the awk command -- and be sure to note the two points at the end of that page) to reflect whatever you've named your target volume, then make it executable and test it. It might be a good idea, however, to log the errors instead of pitching them into /dev/null, at least until it's debugged.

Gorisan
08-02-2008, 12:21 AM
Hmm... May I ask why? Are you trying to set up unattended backups? If so, there is a way to tell the system not to unmount volumes when you log out.


Thank you for the information you have provided :)

Myself, I will not need to use such a script. However for my wifes machine I will be running such a setup as to be as automatic as possible. Sort of set it and forget it type thing. If I have the Firewire Drives mounted all the time then the units will power up and down at the will of the Energy Saving Utility,
Im hoping to bypass such cycles by having the Drive (partitions) unmounted.

Therefore only power up just before a backup occurs, then unmount (power down) after-words.

(Hoping this is in the realm of there are no dumb questions)

again thanks for information provided.
At this point I am still tinkering to get what I need/want in the way of a backup scheme. I must say I do like SuperDuper so far :D

dnanian
08-02-2008, 09:15 AM
One small thing to note: SuperDuper! does this completely automatically with scheduled backups. If the drive isn't mounted we mount it, copy and unmount...

Gorisan
08-03-2008, 01:07 AM
...weird I could have sworn I posted a reply already.

Anyhow Indeed SuperDuper does do that however I have tried again and I notice it does not seem to work for backing up in sparse image mode.

at least for me

Gorisan
08-03-2008, 01:59 AM
Ok, Figured it out.

You can run a backup, then create a disk image of said backup.
Running in a schedule mode, I can mount/unmount seamlessly.

Not exactly what I was trying to do in the first place, but its more than good enough.

Thank you all for your patience
I will now go enjoy SuperDuper.

Great Software!
Gorisan