LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-12-2016, 08:36 AM   #16
matrixebiz
Member
 
Registered: Jun 2011
Posts: 48

Original Poster
Rep: Reputation: Disabled

Oh, ok, yeah, I do not have a Linux machine, I was just told to create the cron script at my hosting site cPortal with the Linux command I want to use, so that is why I have asked here what the command is that I will use, to do what I wanted. So I am not even using a Linux box myself to do any of this, I'm just looking for the command line to use.
 
Old 08-12-2016, 08:42 AM   #17
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,469

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by matrixebiz View Post
Oh, ok, yeah, I do not have a Linux machine, I was just told to create the cron script at my hosting site cPortal with the Linux command I want to use, so that is why I have asked here what the command is that I will use, to do what I wanted. So I am not even using a Linux box myself to do any of this, I'm just looking for the command line to use.
Ok, that's fair enough, so yeah the command line you previously gave:
Quote:
Originally Posted by matrixebiz View Post
Code:
find /directory -name "*.tc" -type f -amin +10 -delete
Should do what you want.

You'll just have to confirm the correct /directory path.

If the cPortal cron e-mails you the output of jobs then you could set up the command without the -delete and it would mail you the list of files in the folder that match the criteria.
 
2 members found this post helpful.
Old 08-12-2016, 08:50 AM   #18
matrixebiz
Member
 
Registered: Jun 2011
Posts: 48

Original Poster
Rep: Reputation: Disabled
Ok, thx, yes it has the option to email me.

So what does the -delete option do then, just show me on screen what files got deleted and has nothing to do with the actual files getting deleted?
 
Old 08-12-2016, 08:53 AM   #19
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,469

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by matrixebiz View Post
So what does the -delete option do then
It does the actual file deletion.
 
Old 08-12-2016, 08:55 AM   #20
matrixebiz
Member
 
Registered: Jun 2011
Posts: 48

Original Poster
Rep: Reputation: Disabled
Oh, got confused when you said : could set up the command without the -delete
 
Old 08-12-2016, 08:59 AM   #21
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,469

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by matrixebiz View Post
Oh, got confused when you said : could set up the command without the -delete
If you set it up without the -delete then it'll mail you a list of files that match. You could then use this to check that the command is finding files correctly, in the correct folder etc. before you change it to do the actual deletion with the -delete
 
Old 08-12-2016, 09:04 AM   #22
matrixebiz
Member
 
Registered: Jun 2011
Posts: 48

Original Poster
Rep: Reputation: Disabled
Okay, awesome thank you for the help
 
Old 08-15-2016, 07:24 AM   #23
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,469

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Did this work out for you?
 
Old 08-15-2016, 08:28 AM   #24
matrixebiz
Member
 
Registered: Jun 2011
Posts: 48

Original Poster
Rep: Reputation: Disabled
Yes, thank you
 
Old 08-15-2016, 08:48 AM   #25
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,469

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Great, use the "Thread Tools" dropdown and you can mark this one as [Solved]
 
  


Reply


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
Simple shell script that will delete every 5 minutes all files with extension log Alexis2156 Programming 3 11-06-2014 02:10 PM
Shell script to get name of file, delete original file, rename blank file chrisgti Linux - General 11 09-15-2012 02:49 AM
Find out if a file was modified in the last 2 minutes.... cricos Programming 5 04-06-2005 02:57 PM
Tried to delete file as root but it says I don't have permission to delete it! beejayzed Mandriva 23 03-12-2004 02:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:27 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