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, 10: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, 11:10 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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, 11:52 AM   #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 11:54 AM.
 
  


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 04:58 PM
Script to delete older files not running . linuxlover.chaitanya Linux - Newbie 10 01-12-2009 01:27 AM
Automated script to DELETE files older than 2 days in a Particular folder siddhartha_ece2004 Linux - Newbie 14 07-11-2008 05:46 AM
Script help - delete files older than 45 days but exclude the system files jojothedogboy Linux - Software 3 06-13-2008 03:43 PM
script to auto delete files older than X days nocnoc Programming 17 12-06-2006 08:30 AM

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

All times are GMT -5. The time now is 07:31 AM.

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
Open Source Consulting | Domain Registration