[SOLVED] How do I delete a file that is x minutes old
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello, I am using a hosting site and I am told that I need to create a cron job to automatically delete the file I want to, so what is the Linux command to force remove all .TS files in my directory that are older than 10 minutes? Thank you
basically what the hosting site told me to do is in my control panel is setup the cron job to run every 15 min and it has a line to put the Linux command that I want it to run. do I have to setup multiple tasks then instead of one command?
Just to point out that your plan may result in files being as old as 25 minutes old before being deleted. For example, if you run the cron at point A, you will delete any files older than 10 minutes old. That may leave files that are just under 10 minutes old. By the time you get to your next cron run, those files will be just under 25 minutes old. As long as you're fine with that, all is ok.
I don't know if you're being serious or sarcastic, so I'll go with serious.
man pages are the manual pages for commands.
You can access the man page by typing: man <command> at the linux command prompt.
If you don't have command line access to a system then using Google and searching for man <command> will give you a list of resource links. My preference is for links to linux.die.net So in this case http://linux.die.net/man/1/find is a good starting point.
find /directory -name "*.tc" -type f -amin +10 -delete
What the heck is a man page
If you're kidding, it's the male equivalent of a woman page.
If you're not, the man command shows you the manual page(s) for software and commands available on your computer. So, for example, man find will tell you more about the find command.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.