I have a user-written perl script that archives files with an mtime > than x months from specified directories that is no longer working. There are a number of directories that are processed by the script. The problem started the day after I upgraded my servers from SLES 11 SP1 to SLES 11 SP2. I believe that I have tracked the problem down to the zip command not processing the files in the include list.
The script logs messages into its own log file and this file contains the following messages for each of the directories that contain data to be archived:
warning [/home/hlinke/DBReports/zi7EL3DY]: zipfile is empty
test of /home/hlinke/DBReports/DBReports_2012AUG.zip FAILED
zip error: Zip file invalid, could not spawn unzip, or wrong unzip (original files unmodified)
The perl command that is failing is
$cmdstat = system("zip -mTrjq $archfile $dir -i\@$zi");
I inserted print statements into the perl script to reveal the values of the symbolic variables used and found that 'cmdstat' is set to 2048. I built a command-line-interface zip command to test with based on the symbolic values and have been able to recreate the problem. The command that I am testing with is:
zip -Trjq /home/hlinke/DBReports/DBReports_2012AUG.zip /xs2files/DBReports -i@/home/hlinke/DBReports/DBReports_2012AUG_include.lst
Note that the command is running against production data so I removed the option to 'move' (i.e. delete) the source files after they are added to the archive and I also modified the file containing the include list to contain only one file.
I've tried all kinds of variations to the -i switch to no avail. I originally thought that maybe perl was upgraded as part of the SP2 upgrade but ruled out perl when I was able to recreate the problem via the CLI.
I am in a bind as the script hasn't been archiving data for over 2 months now and the file system has grown from 78% to 96%. This filesystem does tend to grow this time of year due to the nature of the business so we didn't think that a script was failing.
Any ideas as to what changed with the SP2 upgrade? What do I need to change with the zip command to get it working again? This script was written around 2005 and has been worked until the SP2 upgrade.