Sponsored Content
Top Forums Shell Programming and Scripting Deleting files and directory's older than 3 months Post 302745581 by maaaaarco on Monday 17th of December 2012 02:54:25 PM
Old 12-17-2012
Read the man page of find
Code:
$man find

Especially the part about -printf

and this option
Code:
%Ak    File's last access time in the  format  specified  by  k,
                     which  is  either `@' or a directive for the C `strftime'
                     function.  The possible values for k  are  listed  below;
                     some  of  them might not be available on all systems, due
                     to differences in `strftime' between systems.

If you continue reading from this part, can find the K param
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Listing files older than 2 months

A script or command to list files older than 2 months in a specified directory and remove it. (3 Replies)
Discussion started by: pbekal
3 Replies

2. Shell Programming and Scripting

Deleting files older than a given date

Hi all, I want to delete all files in a directory which are older than a given date. I thought of doing it by creating a file by the required date by using touch command. And then i would use find command on that file and try to find files older than that. I searched the man and found a... (3 Replies)
Discussion started by: rajugp1
3 Replies

3. UNIX for Dummies Questions & Answers

deleting files with dates 3 months ago

please help me with this????? :confused: :confused: i need to create a program that will run in unix that will delete all files in a given directory that is at least 3 months old. first the program will need to automatically know what date it is right now to determine the files it will... (3 Replies)
Discussion started by: godalle
3 Replies

4. Shell Programming and Scripting

Delete files older than 3 months.(read date from the name of the file)

Guys, My log files stored in the date format format below(log_20080714072942): TIMESTAMP=`date +%Y%m%d%H%M%S` LOG=/log/log_${TIMESTAMP}.log I'm looking for a shell script which deletes all files which is older than 3 months from today. Regards, Bhagat (3 Replies)
Discussion started by: bhagat.singh-j
3 Replies

5. UNIX for Advanced & Expert Users

Deleting older files of a particular type

hi This should be easy but i'm obviously missing something obvious. :) I'm looking to delete files from yesterday and older of extension .txt and there a range of subfolders with these files in them. The command runs but doesn't delete anything. SUSE 10. find /testfolder -maxdepth 2 -type f... (6 Replies)
Discussion started by: cmap
6 Replies

6. Shell Programming and Scripting

gzip files older than 1 months

Hello, I want to gzip files in a folder in bulk i.e. all files older than 1 month should be in *.gz format. Could you please suggest how this can be achieved. Thanks. Regards, Alok (1 Reply)
Discussion started by: alok1301
1 Replies

7. Shell Programming and Scripting

Deleting files older than 6 hours

Hi All, I am using the below script to find all the files in a folder which are older than 6 hours and delete all those files, but some how I am not getting the required output. find $HOME/Log -type f -name "*.log" -amin +360 -exec rm *.* {} \ can any one please check and let me know... (13 Replies)
Discussion started by: subhasri_2020
13 Replies

8. Shell Programming and Scripting

need a code for moving the log files older than 2 months

Hi Viewer, I need logic code for moving the logs files from one directory to another directory. source :/xxxxxx/ xxxxxx / xxxxxx / xxxxxx / log --- under log directory we have so many files from last two years Here I need to check the files older than two months and I need to move in... (5 Replies)
Discussion started by: munna_su
5 Replies

9. Shell Programming and Scripting

Command to Count the files which is Older than 3 months?

Hi Gurus the count of files in a particular Directory... ls -lrth | grep -c ^- can any one share the command to Count the files which is Older than 3 months So please help me out in this Thanks in Advance (2 Replies)
Discussion started by: SeenuGuddu
2 Replies

10. Shell Programming and Scripting

Need help deleting files one week older

Hi, I need to delete *.bad files which are 1 week old. How can I achieve that. I tried doing through below script but it deletes all the files. find ./ -mtime +7 -exec rm *.bad {} \; The below one works but i want to delete only files with .bad extension find . -mtime +7 | xargs rm (2 Replies)
Discussion started by: Gangadhar Reddy
2 Replies
SCRYPT(1)						    BSD General Commands Manual 						 SCRYPT(1)

NAME
scrypt -- encrypt and decrypt files. SYNOPSIS
scrypt {enc | dec} [-M maxmem] [-m maxmemfrac] [-t maxtime] infile [outfile] DESCRIPTION
scrypt enc encrypts infile and writes the result to outfile if specified, or the standard output otherwise. The user will be prompted to enter a passphrase (twice) to be used to generate a derived encryption key. scrypt dec decrypts infile and writes the result to outfile if specified, or the standard output otherwise. The user will be prompted to enter the passphrase used at encryption time to generate the derived encryption key. OPTIONS
-M maxmem Use at most maxmem bytes of RAM to compute the derived encryption key. -m maxmemfrac Use at most the fraction maxmemfrac of the available RAM to compute the derived encryption key. -t maxtime Usr at most maxtime seconds of CPU time to compute the derived encryption key. In scrypt enc, the memory and CPU time limits are enforced by picking appropriate parameters to the scrypt key derivation function. In scrypt dec, the memory and CPU time limits are enforced by exiting with an error if decrypting the file would require too much memory or CPU time. EXIT STATUS
The scrypt utility exits 0 on success, and >0 if an error occurs. Note that if the input encrypted file is corrupted, scrypt dec may produce output prior to determining that the input was corrupt and exiting with a non-zero status; so users should direct the output to a safe location and check the exit status of scrypt before using the decrypted data. SEE ALSO
Colin Percival, Stronger Key Derivation via Sequential Memory-Hard Functions, May 2009, Presented at BSDCan'09. HISTORY
The scrypt utility was written in May 2009 by Colin Percival as a demonstration of the scrypt key derivation function. The scrypt key derivation function was invented in March 2009 by Colin Percival in order to allow key files from the tarsnap backup system to be passphrase protected. BSD
May 24, 2009 BSD
All times are GMT -4. The time now is 11:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy