HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

Script advice

 
Fenglin
Regular Advisor

Script advice

Hi

I created a script to gzip some files in a specified directory. The files in the directory are owned by a, group b. My script was created by root,group sys.

When I run the script manually, it works perfectly fine. When I schedule it, it works partially. May I know why?

What do I need to change to make it work perfectly when I schedule it?

Regards
Feng Lin
5 REPLIES
Michal Kapalka (mikap)
Honored Contributor

Re: Script advice

hi,

if you schedule it under root, them use

su - USER_A or run the script directly under the USER_A crontab.

mikap
Patrick Wallek
Honored Contributor

Re: Script advice

>>When I schedule it, it works partially.

What do you mean "it works partially"? What works? What does not work? What exactly does it do when you schedule it?

Examples of what is not working, and the script itself, would be helpful.
Fenglin
Regular Advisor

Re: Script advice

Hi

What I meant was only some of the files that need to be gzipped got gzipped. The rest were not gzipped.

Regards
Feng Lin
Patrick Wallek
Honored Contributor

Re: Script advice

Are any errors generated?

Are you running the script as root or as some other user?

Again, actually seeing your script might help us, as would seeing the file list so we can see what was and was not gzip'd.
Fenglin
Regular Advisor

Re: Script advice

Hi

I will try Mikap advice first.

Cheers
Feng Lin