This is actually quite a straight forward process, I have used this several times for long shell scripts. Normally I would break the process into a number of component parts, then allocate each to a sub section of a shell. On completion of each section or sub section I write a file in "/tmp" with a numeric value in it, the shell script accepts a number of arguments. With one being to start where the shell finished last time, this is identified by reading the contents of the file in "/tmp".
Thank you for the response.
I was reading about makefile and it seems to me it is about compiling a program.
You can use makefiles for anything. It is a list of what files are used to create what files, and what programs are used to create them. It can start in the middle, by seeing what files have already been created.
I don't suppose, on the third try, you could actually answer my question?
Is there a file which is created on success but not created on failure? Yes, or no?
Here is an example, written on the assumption your programs create no files.
When you run make, it will attempt to create file1 through file5 in that order, by running the commands you tell it to. If there is an error, it will detect the nonzero return code and stop in the middle. Next time you run it, it will remember where it left off by what file1...file5 files have and haven't been created.
Run 'make clean' to remove the files and start over from the beginning.
NOte that the eight leading spaces are actually tabs and must be tabs for make to work.
@Coronoa...thank you again.
The log file is created no matter what , whether the command is successful or not.
How do I tell the program to resume from say "file 5" ?
@Coronoa...thank you again.
The log file is created no matter what , whether the command is successful or not.
How do I tell the program to resume from say "file 5" ?
That's what the 'touch' is for in the makefile, to create flag files on success to remember where it left off.
Sorry if this is the wrong place for this. I haven't done UNIX Admin in a long time and am trying to update the utilities on a Solaris server so that I can get Apache 2.4.25 installed. I am finding a lot of utilities that are just too far out of date and some versions are no longer supported. So... (0 Replies)
Hi, I put a for loop in a script to eject backup tapes from the robot. The command echo' output goes to the log file without problem, but command vmchange's output does not go to the log file although it's working fine. It still displays on the screen. I've tried '2>&1 1>$log', but nothing changed.... (5 Replies)
I would like to get pm-suspend (or any other suspend method) working for a small new desktop computer. It is based on a Zotac GF-8200 ITX motherboard and an AMD Athlon II X@ 240 CPU using ArchLinux x86_64.
The pm-suspend script works, apparently putting the machine into suspend correctly... (0 Replies)
I'm trying to build some python modules on a Solaris 10 machine. It has gcc as /usr/sfw/bin/gcc.
# CC=gcc python setup.py build
running build
running build_py
running build_ext
cc -c actread.c -o actread.o
unable to execute cc: No such file or directory
error: command 'cc' failed with exit... (8 Replies)
Hi!
I have this situation with 3 shellscripts.
One is a "startscript" that simply calls other scripts. This one is scheduled with cron to run at regular intervals. That script runs what I'll refer to as Script 1.
Script 1 in turn runs script 2 (import_catalogs_buyer.sh)
Sometimes, seemingly... (2 Replies)
I have a script that occasionally has a command here and there that fails and I would like to set my script up to just re run the command if the exit code is 1.
Is there a simple way to do that without if/thens or redirecting to the command again? (5 Replies)
In our directory there are too many files, & if I try to execute mv *.gz or rm *.l command it fails, providing error string as - 'arg list too long'. This doesnt happen always, is there any way we know, limit on the rm & mv command so we can take care of this failure in future executions ? (9 Replies)
I am trying to send email using the "mail" command. I keep getting an "exec failed. errno=2." message.
Here is one the commands I have tried:
mail test@mycompany.com < test1.out
Any ideas what may be causing this error msg? (1 Reply)
Hi everybody,
I am wondering if there is any tool or website out there which can track who is viewing my resume. It is very frustrating when you send your CV or Cover Letter and you receive no feedback from the company, you don't even know if they have checked it out.
Thanks for your help (1 Reply)