Shell Programming and Scripting

BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

Script Verification

👤 Login to reply

Old 04-07-2012
k33k00 k33k00 is offline
Registered User
Join Date: Apr 2012
Last Activity: 7 April 2012, 7:08 AM EDT
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Script Verification

Hi eveyone
I am planning to use crontab to delete all files in my donwloads directory that are older than one hour

I will be using crontab to run this script

find /home/kee/downloads/* -daystart -mmin +59 -type f -name  -exec rm -r {}\;

could you please let me know if the above script will remove all files from my downloads directory

It is a slightly modified from this script i found on here which is
find /home/envivio/*/*.ts -daystart -maxdepth 1 -mmin +59 -type f -name "*.ts" -exec rm -r {}\;

Sponsored Links
Old 04-07-2012
bartus11's Unix or Linux Image
bartus11 bartus11 is offline
Registered User
Join Date: Apr 2009
Last Activity: 3 August 2016, 11:03 AM EDT
Posts: 3,733
Thanks: 7
Thanked 1,153 Times in 1,123 Posts
You don't need asterix or the -name clause:
find /home/kee/downloads -daystart -mmin +59 -type f -exec rm -r {}\;

Before putting it into your crontab, test it first on the command line.
Sponsored Links
👤 Login to reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script for verification of Data corruption manish_tcs_hp Shell Programming and Scripting 4 12-07-2010 08:14 PM
SSH login verification sriram003 Shell Programming and Scripting 4 03-26-2007 12:27 AM
Email address verification script Ramdas Shell Programming and Scripting 4 01-15-2007 01:51 AM
Verification of a script already running - where to do it miwinter UNIX for Dummies Questions & Answers 2 08-07-2006 10:32 AM
verification? sheranjem UNIX for Dummies Questions & Answers 3 06-06-2005 01:08 PM

All times are GMT -4. The time now is 07:10 PM.

Unix & Linux Forums Content Copyright©1993-2018. All Rights Reserved.
Show Password

Not a Forum Member?
Forgot Password?