Link to home
Start Free TrialLog in
Avatar of MichaelBalack
MichaelBalackFlag for Singapore

asked on

Why this bash script ends up with error?

This is using a SuSE Enterprise Linux 11 with SP4. A bash shell script was used to do the backup (zipped) from /mm/data1/sqmdat to /mm/data1/Backup. /mm is a cifs mounting of //mmcentral/mm. Please see the attached script. This shell script was scheduled to run as a cron job at 4:30 am daily.

The problem is, we getting a series of "MM Remove Error: DMPxx (CODE: 1)" everyday. If I were interpret correctly, this script is do a check on files for past 65 days, and will "list" those files and then do a "zipping". After that, these zipped files were "moved" to /mm/data1/Backup folder. The last step is, to do the removing. However, it seems that problem happened here, and eventually a mail was sent with "MM Remove error".

Appreciate for the helps.
bck.mmTEST.sh
Avatar of arnold
arnold
Flag of United States of America image

What is the error that is displayed when run?
Do you have /mm as a mount point?

1) the check move error is disabled.

You are not checking the file, test -e
Potentially sonething leads to a file going missing, deleted by sonething else.
Avatar of MichaelBalack

ASKER

Hi arnold,

1) the check move error is disabled.

Yes, check move is disabled.

The error is, MM Remove Error: DMPTC (CODE: 1); sent as email to us.

No, this is the script located in server.
Hi arnold,

I did the test run, and see the error,

+ /usr/bin/zip -9 -qr DMPQQ.zip DMPQQ
zip I/O error: Permission denied
zip error: Could not create output file (DMPQQ.zip)
+ ZCODE=15
I tried "touch good", it shows permission denied. Look like suddenly not permissions, strange.
Avatar of noci
noci

Appearantly zip files, and is unable to create a file in the $RST_DIR
(And you don't send messages or signal the ZCODE error..., the whole block is disabled).

check if you have access to: /mm/data1/dat
(RST_DIR is used because it is the default and (cd $RST_DIR) and there is no path on the .zip file.)
Yes, verify that is permission issue.
ASKER CERTIFIED SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks both experts' advises, this is folder permission issue.