Thanks to the helpful people at virtualdr I was able to fix my samba problem, but now one more problem exists.
The linux server I setup is going to have a CD-Writer installed into it for backing up once a week.
I know how to enable scsi emulation on the burner but could someone help me with creating a shell script and automating it with cron. What I would like to be able to setup is for the machine to burn the contents of a directory (for example one called backup) onto a CD at 11:30pm every Friday, then delete the backup file after it has finished and for the CD to be ejected.
I know to backup to cd I enter to following commands at the shell prompt.
Ok I have been reading various how-to files for a while and this is what I have come up with could someone please have a look at it and let me know if it would work, also how to make the CD eject after it has finished.
Yuri.
Script
Your script is fine Yuri, but change the first line to:
#!/bin/bash
as your using the bash shell, if your not just leave it as sh.
The command to eject is simply eject, but i tried it on a suse 6.2 box and it didnt work, it did work on a suse 7.2 box though, so you should check it before making it part of your script.
In the rm command add a -f (force) in case any files don't want to be removed, this could make your script hang, and add exit 0 to the end of your script to end it tidily.
Make sure the script is saved in a dir that is in your $PATH eg /usr/bin, to check your path type echo $PATH.
To make it exe type chmod 755 backup.sh if your script is saved in a dir with your path typing backup.sh will execute it.
Cron
Ok so you want to make the script run at 2330 every friday, to do this do the following.
type: crontab -e
this will put you into crontab's edit mode, press i or insert, now add the lines:
# Backup script to be run each friday @ 11.30pm
30 23 * * 5 root /usr/bin/backup.sh
Explanation: 30 = 30 mins past the hour, 23 = 11 o'clock, 5 = 5th day (friday)
To save do the following (in red):
press escape
now type a : followed by wq (write, quit) and press return, to exit without saving do q!
If this does not work check man crontab and man 5 crontab.
As is the case with any script no matter now simple TEST it to you are 100% on it, espically in your case where there is an rm command running automatically.
I have attached a simple document on shell scripting to help you out, you will easily learn the basics from it, go to the Linux Documentation Project and look for the Advanced Bash Scripting how to when you feel you need to learn more about scripting.
Rami3 thank you very much for your help I will make the changes and put the script file in to cron. And let you know how I go.
VirtualDR would not be the same without you.
Thanks.
Yuri.
The script works really well and does exactly what I need it to do, the only problem is that every file/folder is only 8 characters. Is there any way to make it so that the folders and files can be longer up to 255 characters?
Yuri.
There are a lot of options described in the man page. If you keep your filenames to 8.3 lower case, you won't need to be bothered with most of them. The "-J" option (for Joliet) will allow longer Windows style filenames, but if you actually use longer or case sensitive names your file names will look funny or not work in a minimal ISO9660 system.
That's about the best I could come up with. Hope it helps. -mk