Sponsored Content
Top Forums Shell Programming and Scripting Who can help me with a specific chmod cron job? Post 302311475 by methyl on Tuesday 28th of April 2009 08:26:54 PM
Old 04-28-2009
I agree with jim mcnamara findings. The original cron just changed the permissions of the directory but not the files within the directory.

The whole process can be one script called from cron. This untested example avoids expanding "*" to an unknown number of filenames, deals with filenames containing spaces, and will work for any number of files:

Code:
#!/bin/ksh
for DIR in "/www/aublg/blog/userfiles/images" \
   "/www/aublg/blog/userfiles/flash" \
   "/www/aublg/blog/userfiles/documents"
   do
          if [ -d "${DIR}" ]
          then
                   cd "${DIR}"
                   find . -type f -print | while read FILENAME
                   do
                            chmod 666 "${FILENAME}"
                   done
          else
                  echo "Directory missing: ${DIR}"
          fi
   done


Last edited by methyl; 04-28-2009 at 09:27 PM.. Reason: Code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Cron JOB

I have a cron job that ran for 3 months; all the suden, it stops working. There were no changes in the script. Is there away that I can find out why? can someone with root permission disable my cron-job? Is there away that I can look into the system to see who may have done that? My cron job... (1 Reply)
Discussion started by: bobo
1 Replies

2. UNIX for Dummies Questions & Answers

Cron Job

Hi everybody ....I am trying to write a cron job for event based subscription for a tool called Microstrategy...if anybody have idea about this please help me... Thanks in advance ark (7 Replies)
Discussion started by: arksal
7 Replies

3. UNIX for Dummies Questions & Answers

cron job from specific folder

i'd like to be able to run a cron job from a specific folder /var/www/html a php script which imports rss feeds i created a simple shell script cd /var/www/html php -q import.php webmin says it executed correctly, but when i check the site, nothing has happened what am i doing... (1 Reply)
Discussion started by: sanchoquixote
1 Replies

4. UNIX for Dummies Questions & Answers

CRON usage for CRON job

can anybody explain the usage of CRON for adding a cron job. please provide an example also for better understanding !!! Thanks (1 Reply)
Discussion started by: skyineyes
1 Replies

5. Shell Programming and Scripting

create a chmod cron job help please

hi all, I'm so embarrasingly new; apologies. So here's my dilemma; files are being uploaded to the server via a php script... this is therefore assigning ownership to 'nobody' rather than the account 'user'. It's screwing with the permissions and then the owner can't ftp download images... (2 Replies)
Discussion started by: sirj
2 Replies

6. Solaris

cron job starts new cron proccess

I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)
Discussion started by: ron76
3 Replies

7. UNIX for Advanced & Expert Users

Run A Job in Cron On A Specific Day Excluding Holidays

Hi, I want to run a job in cron on a specific date(say 25th of every month) excluding holidays. Can anyone provide some hints to do this? Thanks for any inputs. (1 Reply)
Discussion started by: sktkpl
1 Replies

8. Solaris

Cron job running even after cron is removed

Hi , I have removed a cron for particular user , but cron job seems to be running even after the cron entry is removed. The purpose of the cron was to sendmail to user ( it uses mailx utility ) I have restarted cron and sendmail service still user is getting mail alerts from the cron job. And... (4 Replies)
Discussion started by: chidori
4 Replies

9. Shell Programming and Scripting

Commented cron job -- cron monitoring

Hi I have a requirement to write a shell script,that will check the all commented job in cron job.Please help !! (2 Replies)
Discussion started by: netdbaind
2 Replies

10. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies
GRUB-MKNETDIR(1)						   User Commands						  GRUB-MKNETDIR(1)

NAME
grub-mknetdir - prepare a GRUB netboot directory. SYNOPSIS
grub-mknetdir [OPTION...] DESCRIPTION
--compress=no|xz|gz|lzo compress GRUB files [optional] -d, --directory=DIR use images and modules under DIR [default=/usr/lib/grub/<platform>] --fonts=FONTS install FONTS [default=unicode] --install-modules=MODULES install only MODULES and their dependencies [default=all] -k, --pubkey=FILE embed FILE as public key for signature checking --locale-directory=DIR use translations under DIR [default=/usr/share/locale] --locales=LOCALES install only LOCALES [default=all] --modules=MODULES pre-load specified modules MODULES --themes=THEMES install THEMES [default=starfield] -v, --verbose print verbose messages. --core-compress=xz|none|auto choose the compression to use for core image --net-directory=DIR root directory of TFTP server --subdir=DIR relative subdirectory on network server -?, --help give this help list --usage give a short usage message -V, --version print program version Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options. Prepares GRUB network boot images at net_directory/subdir assuming net_directory being TFTP root. REPORTING BUGS
Report bugs to <bug-grub@gnu.org>. SEE ALSO
grub-mkimage(1) The full documentation for grub-mknetdir is maintained as a Texinfo manual. If the info and grub-mknetdir programs are properly installed at your site, the command info grub-mknetdir should give you access to the complete manual. grub-mknetdir (GRUB) 2.02-2ubuntu8.3 July 2018 GRUB-MKNETDIR(1)
All times are GMT -4. The time now is 11:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy