How to change file permissions in Unix shell script

Recently a unix shell script we have been using for some time stopped ftp'ing a file usnig .netrc  info to login to the ftp site.

The login information hasn't changed and the only way I am able to manually ftp the file to the site is if i change the file permissions to the .zip file the script creates.  I was thinking of adding this line to the entire shell script to have it do this form me but need help.

I have attached the lines of code in the script where the file is encrypted with pgp right before it is ftp'd.  Could someone tell me what line i could add to ensure the permissions allow for the file to be ftp'd?
PGPPATH=/var/PGP/pgp-6.5.8
export PGPPATH
PATH=$PATH:$PGPPATH
export PATH
 
pgp +force -e -o $FILENAME.zip.pgp $FILENAME.zip data_center

Open in new window

mygenAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

yuzhCommented:
It denpands on what type of users you allow them to do ftp.
If you allow ALL users to do it, you can add:
chmod a+r $FILENAME.zip
or
the user in the same group to FTP the file (eg $FILENAME.zip ) :
chmod g+r $FILENAME.zip
just put the statement after the file is created.
man chmod
to learn more details.
0
MuhammadBilalCommented:
Just as said by yuzh if you want all users, groups and others to ftp the file then:

chmod 444 $FILENAME.zip

If you want group member of the file to read it and others members deny any access use this:
chmod 740 $FILENAME.zip
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Shell Scripting

From novice to tech pro — start learning today.