Remove old files using perl




















Perl Script to remove files older than a year Ask Question. Asked 7 years, 6 months ago. Active 7 years, 6 months ago. Viewed 4k times.

I am trying to make a script which will delete files older than a year. This is my code:! Also -mtime is But a leap year days I have to change my script. Improve this question. Just FYI, mtime is the time the file's contents were last changed, not the age of the file since it was created.

Why bother with Perl? Just use find directly with the -delete option. My requirement is a Perl script. Add a comment. It removes one or more files from the file system. It is similar to the rm command in Unix or the del command in Windows. For full documentation see perldoc -f unlink.

The standard way to copy a file is to use the copy function of File::Copy. For documentation visit perldoc File::Copy. Toggle navigation Perl Maven. Standard output, standard error and command line redirection Warning when something goes wrong What does die do? Unknown warnings category Can't use string How to check this? Erasing an array..

Mechanism of foreach iteration.. Comin out of a directory.. Back references. Renaming files. Setting up multiple directories. HTML Tokeparser problem. How to install a module in local linux machine. CHMOD query. Replace block of HTML. Parent process unable to read messages from child. A case of a missing file that is somehow refrenced.

Variable call subroutine? Modifying a perl file upload script to handle 10 f. Extracting difference in hours DB Files. Module to grab html pages. Perl - Bit Manipulation. How to write a module? Extract first 20 words. Conversion of Hex bytes to binary and vice versa. Help in regular expression. BB Code. Brain Hurts.. Forcing PERL to write to a logfil. Parsing of Hex bytes in Perl. Column alignment. Summation of file size according to user. Perl - remove unwanted lines.

Simple Exact string match. Perl to export tab delimted file to Quattro Pro. Loop query. Importing a regular expression from a file.

Upgrading ActiveState Perl. Perl help needed. Net::FTP and forks, Win Moved: Just try to solveit, if you can solve. Finding Modified dir's top level Windows. Expiry Script. DBI module missing. Calling external programs. Connecting to MySQL over an unreliable network. Emailing from Perl on Windows platforms. Slicing a long number. Cheers etc. Perl and. NET Cryptography. Linebreaking in html. More details link to reveal a data column.

How to clean up week old log files using perl. HTML Data. Very Very Urgent. Happy Christmas. Regular Expression Help. Windows Mailer. Removing blank columns in csv file. Missing modules problem on host. CGItemp files. Perl and Guestbook. Perl and XML. FTP from Perl? Please find me a solution with this problem. Detecting if file is Macintosh, Windows or Unix. RegEx in scalar. Tk button auto repeat.

How to create a file with specific date and time. Send variable to another file. Using Grep to search through an array? Is this possible? Cleaning out files for a specified user. How to use Perl references? Use Perl to create symlinks. Issue with Grep. Eights and nines. Problem with localtime.

CHMOD a perl script created file. Finding the latest version number. Writting a script to break a file. Attach text file to email.



0コメント

  • 1000 / 1000