Ok Rich...
For whatever reason your solution no longer works. No matter what I place in the exittc script, it doesn't execute anything.
After looking back at the commands I place in the exittc script at the beginning, I missed an important clue.
The first two commands were:
rm -rf /home/tc/searchfiles/*
cp -rf /tmp/csvfiles/* /home/TC/searchfiles/
So, one would think that even if the "rm" command didn't work for some reason, the "cp" command would have at least copied the new files into the same directory. This would mean that there would be additional files there the next time we looked. Continuing on thru the rest of the script, the next command we get to is:
sudo /usr/bin/filetool.sh -b
This should have run the backup. If the backup had actually run, then the new files copied into the /home/tc/searchfiles folder would have been preserved on the reboot. And finally we get to the last command in the script:
sudo /usr/bin/exittc.orig
This is the renamed exittc bin file that would normally run before we renamed it and set up the script. On the surface it would appear that this is the only command from the script that actually worked. But that is where we were wrong!!!
To be sure ANYTHING was happening with the exittc script I went back and modified the last command to this:
# sudo /usr/bin/exittc.orig
Thus effectively commenting out the command and preventing it from running at all "IF" the script was working. So one would expect the rest of the reboot/backup to fail with some sort of error. Well, the system did exactly what it had done with every other test scenario I had been attempting. The results were exactly the same.
- The files in the /home/tc/searchfiles folder were left untouched
- The files from the temporary directory /tmp/csvfiles were never copied to the /home/tc/searchfiles directory and they were lost on reboot
- The system appeared to work as if the exittc script never existed.
Ok, so I am completely lost at this point. I can find no reason for the script to fail unless something has changed in how TCL handles the reboot and backup routines that we are not aware of at this time. I do not believe the script was ever executed even though it has the chmod settings you recommended.
- I have tried setting the onwer, group and permissions everywhere to make sure there were no conflicts
- have even tried taking the backed up folder out of the tc user directory and placing it in the root and changing everything for that to be the new destination. The result is still the same.
At this point it "appears" that the exittc script never executes and the renamed exittc.orig also never executes (because I commented it out).
Any other ideas? I am stumped.
BKM