Crontab deleting files command question


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Crontab deleting files command question
# 8  
Old 05-05-2013
Precise is
-mtime +120 finds files older than 120 days.
-mtime 0 finds files from today.
-mtime +0 finds files older than today, i.e. not from today.

For academic interest, I have written a cleanup script with
\( -mtime +$max_days -o -mtime -0 \)
that cleans files older than max_days and files with a future time stamp.

Last edited by MadeInGermany; 05-05-2013 at 01:36 PM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Crontab question

I need to run an script every 10th and 25th day in every month at 11pm. the script name is /home/ss/automated.sh I tried to execute the script every day and everytime with the below syntax. its not executing it from crontab. * * * * * /home/ss/automated.sh Any idea why it not... (6 Replies)
Discussion started by: ramkumar15
6 Replies

2. Shell Programming and Scripting

Bash script deleting my files, and editing files in subdirectories question

#!/bin/bash # name=$1 type=$2 number=1 for file in ./** do if then filenumber=00$number elif then filenumber=0$number fi tempname="$name""$filenumber"."$type" if (4 Replies)
Discussion started by: TheGreatGizmo
4 Replies

3. Shell Programming and Scripting

Deleting all empty files in sub directories with a command

Hello Friends, Im trying to delete empty files in subdirectories with a command. I can find them checking only one directory in each step and then show them with my command like below moreover i could not add removing part: ls -l */* | awk '{if ($5==0) printf "%3s %2d %s... (5 Replies)
Discussion started by: EAGL€
5 Replies

4. Shell Programming and Scripting

output file of the shell script running through crontab is deleting automatical daily.

Dear Friends, I am working on IBM AIX. I have written one script and kept in the crontab as to run daily at 11:38 AM. and the output of the script to be appended to the file generated with the month name. but my file deleting daily and the new file is creating with the output of the shell... (2 Replies)
Discussion started by: innamuri.ravi
2 Replies

5. Shell Programming and Scripting

Deleting files using find command

I want to find the files and delete all the files except the last file. I am using find command , I am sending the find output to a file and getting all the lines except the last one and sending it to the remove command . This is not working. can anyone help me out to do it in the find command... (8 Replies)
Discussion started by: deepaklanka
8 Replies

6. UNIX for Dummies Questions & Answers

Deleting access_log.processed in crontab

Hi, I've worked out that my server was getting clogged with the access_log.processed file. I deleted it using the command > /var/www/vhosts/domain.com/statistics/logs/access_log.processed I also set that up as a crontab job for every Wednesday. What I was wondering is the version using... (4 Replies)
Discussion started by: chickenhouse
4 Replies

7. Shell Programming and Scripting

command for deleting log files based on some condition

Hello, Can anyone pls. provide me with the command for deleting files older then 15 days with a restriction to keep at least 5 files in a directory even if they are older then 15 days. Any help will be highly appreciated. Thanks, Pulkit (4 Replies)
Discussion started by: pulkit
4 Replies

8. UNIX for Dummies Questions & Answers

file deleting question

somehow one of my directories got a number of files whose names start with a dash - e.g. -1129.txt how can I remove them? If I issue rm -1129.txt I get the message of illegal options if I issue rm /-1129.txt I get a message that -1129.txt is not found Lisa HP-UX 11.23 i64 (3 Replies)
Discussion started by: LisaS
3 Replies

9. UNIX for Dummies Questions & Answers

Deleting files with zero length using ls command

Hi, How can I use ls command to Delete all files with zero length in a given path using ls command (I guess awk is required!)? Thanks. (6 Replies)
Discussion started by: GNMIKE
6 Replies

10. UNIX for Dummies Questions & Answers

crontab question

I'm trying to create a crontab entry that will run the who command once per hour Monday-Friday. Any command output should be appended to the file whoison.log in my home directory. This is what I wrote: crontab 0 * * * 1-5 who >> /home/myhome/whoison.log Did I do this right? Thanks (7 Replies)
Discussion started by: Relykk
7 Replies
Login or Register to Ask a Question
XFIG-PDF-VIEWER(1)						Debian Users Manual						XFIG-PDF-VIEWER(1)

NAME
xfig-pdf-viewer - view a PDF document using a PDF browser under X11 SYNOPSIS
xfig-pdf-viewer file.pdf DESCRIPTION
xfig-pdf-viewer is a little shell script, which tries to find out which PDF viewers you have installed on your system and then starts them. xfig-pdf-viewer tries the following PDF viewers with descending priority: - xpdf(1) - kpdf(1) - evince(1) - acroread(1) - gpdf(1) - gv(1) - gnome-gv(1) - kghostview(1) - ghostview(1) If the environment variable PDFVIEWER is set, this is used with highest priority. ENVIRONMENT
PDFVIEWER you can define your favorite browser with this variable, it overrides the priority of the above mentioned viewers. AUTHOR
Roland Rosenfeld <roland@spinnaker.de> SEE ALSO
xpdf(1), kpdf(1), evince(1), acroread(1), gpdf(1), gv(1), gnome-gv(1), kghostview(1), ghostview(1) Debian Project JULY 2006 XFIG-PDF-VIEWER(1)