File Permissions conflict with Cron


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers File Permissions conflict with Cron
# 1  
Old 03-24-2009
File Permissions conflict with Cron

Our site has a page that creates a jpeg graph everytime you load it. I have written a very simple cron job (rm *.jpeg) to delete the graphs once a day. This doesn't happen because the jpegs are owned by nobody:nobody and are write protected.

When I do the job manually I am always asked 'are you sure you want to delete....' which obviously cron doesn't like. If I put a jpeg in the folder that is owned by a standard owner it gets deleted so I know the syntax is correct.

My question is this: Is it easier to change the ownership of jpegs so that they are created with the standard owner or is it easier to make my cron job delete the jpegs even though they are protected?

And how do I go about implementing which ever is easier?

RexJ
# 2  
Old 03-24-2009
Try:
Code:
$ rm -f jpegfile.jpg

In your cronjob.

I am puzzled as to why the jpeg file ends up being owned by nobody:nobody but anyway the above may be the simplest solution.
# 3  
Old 03-25-2009
from the man pages:
Code:
       -f, --force
              ignore nonexistent files, never prompt

# 4  
Old 03-29-2009
Thanks for that.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Cybersecurity

Cron Logs File Permissions

Are there any security risks in having cron logs readable by all (644)? We have scheduled some jobs and have issues we want to investigate, but this is justification provided in rejecting our request: "Cron log will have only read permission for root, we cannot change the permission to make... (2 Replies)
Discussion started by: MKH
2 Replies

2. Shell Programming and Scripting

Setting default permissions without umask or cron jobs

I've got a number of people sending files to me in different directory structures, and users on many different groups who need access to these incoming paths. My problem is that umask assumes a default of 666 for files. No execute bit, meaning that my users can't even see the incoming folders.... (2 Replies)
Discussion started by: Karunamon
2 Replies

3. Shell Programming and Scripting

Conflict with the operator in IF

I am using a script like this source=$1 if ; then echo "got it" else echo "lost it" fi But the script is giving th error like script.ksh: ==: unknown test operator Can i know , is the syntax iam using is correct or suggest me a good way. ... (3 Replies)
Discussion started by: nani1984
3 Replies

4. Shell Programming and Scripting

ksh; Change file permissions, update file, change permissions back?

Hi, I am creating a ksh script to search for a string of text inside files within a directory tree. Some of these file are going to be read/execute only. I know to use chmod to change the permissions of the file, but I want to preserve the original permissions after writing to the file. How can I... (3 Replies)
Discussion started by: right_coaster
3 Replies

5. Solaris

IP address conflict

Hi, I am currently working on 2 SPARC-ENTREPRISE T5220 (cluster servers), named SERVER 3A and SERVER 3B. Both servers have their own Ip ADRESS and share 1 Virtual IP adress to share applications....... Both servers are available , but can't communicate together right now. For example, from... (8 Replies)
Discussion started by: feg
8 Replies

6. Solaris

Solaris 9 IP conflict

Hi Gurus I am in a strange situation. I have a SUN sparc server . The server was having an IP say X..... (this IP X is now being used by another server)..... I have just installed fresh solaris 9 OS on the same server and given new IP say Y. I also configured probe based IPMP with ce0 and... (2 Replies)
Discussion started by: ningy
2 Replies

7. Solaris

Conflict with PIDs

I am trying to determine the root cause of a java process that dies trying to startup during it's cron job. I did go ahead and change the time that it starts up in the cron file and now it starts successfully. However is there a way to determine what PID a process was attempting to get when... (5 Replies)
Discussion started by: vedder191
5 Replies

8. HP-UX

Conflict between df -k and du -sk...again

Hi, I know this has been discussed a number of time but i could not get the exact answer. So need help again. Issue: The two command for same file system shows different size. du -sk shows toatl size is 12780685 KB while df -k 45289229 used allocated Kb /oxt/mantran/bin $ du -sk... (8 Replies)
Discussion started by: malaya_17
8 Replies

9. UNIX for Dummies Questions & Answers

DNS Conflict

I host a few websites for friends and lately my server has been bogging down at times. I think that it is because of a dns conflict. Someone said that by doing a nslookup I should be able to see it and then do a pkill -9 in.named and then do in.named to get it going again. Any feedback on this... (1 Reply)
Discussion started by: thomi39
1 Replies

10. HP-UX

To give the "unzip" permissions & "create" file permissions

Hi, I am a Unix Admin. I have to give the permissions to a user for creating new file in a directory in HP-Ux 11.11 system since he cannot able to create a new file in the directory. Thanks in advance. Mike (3 Replies)
Discussion started by: Mike1234
3 Replies
Login or Register to Ask a Question