LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Closed Thread
  Search this Thread
Old 11-14-2011, 11:48 AM   #1
tango0202
LQ Newbie
 
Registered: Nov 2011
Distribution: RHEL, CentOS, Debian, Gentoo, Ubuntu
Posts: 19

Rep: Reputation: Disabled
Problem creating script to delete files older than 60 mins


ok so I have created a cron job to delete files older than 60 minutes that is set to run every 4 hours.

0 */4 * * * /home/falon/Enviviocron.sh

What is actually running in the script is "find /home/envivio/*/*.ts -daystart -maxdepth 1 -mmin +60 -type f -name "*.ts" -exec rm -r {}\;

for testing purposes I have changed "rm -r" to "ls -l"

The error that I get when I try to run the command manually is...

Find: paths must precede expression: ls
usage: find [-H] [-L] [-P] [-0level] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]

What needs to be changed to allow this to run properly? Got to me something small I am over looking...
 
Old 11-14-2011, 12:10 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590
Please post your thread once and in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread should be closed because it is a duplicate of http://www.linuxquestions.org/questi...0-mins-913478/.
 
Old 11-14-2011, 12:52 PM   #3
tango0202
LQ Newbie
 
Registered: Nov 2011
Distribution: RHEL, CentOS, Debian, Gentoo, Ubuntu
Posts: 19

Original Poster
Rep: Reputation: Disabled
This was done because I was unsure where to post. Post in kernal section has been deleted

Last edited by tango0202; 11-14-2011 at 12:54 PM.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Problem creating script to delete files older than 60 mins tango0202 Linux - Software 12 11-16-2011 05:58 PM
Script to delete older files not running . linuxlover.chaitanya Linux - Newbie 10 01-12-2009 02:27 AM
Automated script to DELETE files older than 2 days in a Particular folder siddhartha_ece2004 Linux - Newbie 14 07-11-2008 06:46 AM
Script help - delete files older than 45 days but exclude the system files jojothedogboy Linux - Software 3 06-13-2008 04:43 PM
script to auto delete files older than X days nocnoc Programming 17 12-06-2006 09:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration