Sponsored Content
Top Forums Shell Programming and Scripting copy files based on creation timestamp Post 302528409 by itkamaraj on Tuesday 7th of June 2011 05:29:32 AM
Old 06-07-2011
Code:
datestamp=`date '+%Y%m%d'`
cp CDLD_$datestamp* $DIR/Temp/

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Moving files based on creation date

Howdy, I'm trying to figure out how to move multiple files based on their creation date. If anyone can enlighten me it would be most appreciated!! Thanks! :D (1 Reply)
Discussion started by: dgoyea
1 Replies

2. UNIX for Advanced & Expert Users

Copy lines from a log file based on timestamp

how to copy lines from a log file based on timestamp. INFO (RbrProcessFlifoEventSessionEJB.java:processFlight:274) - E_20080521_110754_967: rbrAciInfoObjects listing complete! INFO (RbrPnrProcessEventSessionEJB.java:processFlight:197) - Event Seq: 1647575217; Carrier: UA; Flt#: 0106; Origin:... (1 Reply)
Discussion started by: ranjiadmin
1 Replies

3. Shell Programming and Scripting

Move files based on year of creation

Hi All, I have a directory which has crores of files since from 2003 till now. I want to move only the 2003 files to another directory. Please help. Thanks (2 Replies)
Discussion started by: IHK
2 Replies

4. Shell Programming and Scripting

copy lines from log files based on timestamp and sysdate

I am sorry to repost this question. it was not clear, and I had the meeting and didn't response the question on time. I do really need help and appreciate your help very much. I'm looking for a simple shell script that will read lots of audit log file (*.aud) in a log fold every 10 minutes,... (1 Reply)
Discussion started by: percvs88
1 Replies

5. Shell Programming and Scripting

copy lines from log files based on timestamp and sysdate

I'm looking for a command or simple script that will read lots of audit log file (*.aud) in log fold every 10 minutes, and will output to one file based on sysdate - 10 minutes. assume the script is run at 11:12:20, and it should grep the line from Wed Jun 17 11:02:43 2009 to end of file. after... (4 Replies)
Discussion started by: percvs88
4 Replies

6. Shell Programming and Scripting

sort the files based on timestamp and execute sorted files in order

Hi I have a requirement like below I need to sort the files based on the timestamp in the file name and run them in sorted order and then archive all the files which are one day old to temp directory My files looks like this PGABOLTXML1D_201108121235.xml... (1 Reply)
Discussion started by: saidutta123
1 Replies

7. Shell Programming and Scripting

Add timestamp and copy files

Please help me with a command to find all files in directory and copy them into another with a timestamp. I have the code to find and copy the files but unable to add timestamp to the files. Below is the find and copy code which i am using(need to add timestamp) find /root/files -name "*.gz"... (8 Replies)
Discussion started by: vel4ever
8 Replies

8. Shell Programming and Scripting

Moving files based on file creation

Hi, I have a directory having so many number of files. Now I want to move the files which are older than one month (lets say) from this directory to another directory (say BKP dir). Simply, if file is olderthan one month move it from source1 dir to BKP1 dir. My file names doesn't have... (7 Replies)
Discussion started by: karumudi7
7 Replies

9. UNIX for Dummies Questions & Answers

Display files based on particular file timestamp

Hi, I have requirement to list out files that are created after particular file. ex. I have below files in my directory. I want to display files created after /dirdat/CG1/cg004440 file. ./dirdat/CG1/cg004438 09/07/14 0:44:05 ./dirdat/CG1/cg004439 09/07/14 6:01:48 ... (3 Replies)
Discussion started by: tmalik79
3 Replies

10. UNIX for Beginners Questions & Answers

Copy files in order of creation date

Hi everyone :-) I ran into a small issue. I would like to copy some files in the precise order they were created. So the oldest files should be copied first and the newest ones last. I tried cp -r $(ls -1t) ./destination but the files are still not sorted properly. I was thinking, that... (11 Replies)
Discussion started by: officiallyme
11 Replies
BOS_PRUNE(8)						       AFS Command Reference						      BOS_PRUNE(8)

NAME
bos_prune - Removes obsolete files from /usr/lib/openafs and /var/log/openafs SYNOPSIS
bos prune -server <machine name> [-bak] [-old] [-core] [-all] [-cell <cell name>] [-noauth] [-localauth] [-help] bos p -s <machine name> [-b] [-o] [-co] [-a] [-ce <cell name>] [-n] [-l] [-h] DESCRIPTION
The bos prune command removes files from the local disk of the server machine named by the -server argument, as specified by one or more of the following flags provided on the command line: o The -bak flag removes all files from the /usr/lib/openafs directory that have a ".BAK" extension. o The -old flag removes all files from the /usr/lib/openafs directory that have a ".OLD" extension. o The -core flag removes all files from the /var/log/openafs directory that have a "core." prefix. o The -all flag removes all three types of files at once. (If none of these flags are included, the command appears to succeed, but removes no files at all.) To display the timestamp on the current, ".BAK", and ".OLD" versions of one or more files, use the bos getdate command. OPTIONS
-server <machine name> Indicates the server machine from which to remove files. Identify the machine by IP address or its host name (either fully-qualified or abbreviated unambiguously). For details, see bos(8). -bak Removes all files from the /usr/lib/openafs directory that have a ".BAK" extension. Do not combine this flag and the -all flag. -old Removes all files from the /usr/lib/openafs directory that have a ".OLD" extension. Do not combine this flag and the -all flag. -core Removes all files from the /var/log/openafs directory that have a "core." prefix. Do not combine this flag and the -all flag. -all Combines the effect of the -bak, -old, and -core flags. Do not combine this flag with any of those three. -cell <cell name> Names the cell in which to run the command. Do not combine this argument with the -localauth flag. For more details, see bos(8). -noauth Assigns the unprivileged identity "anonymous" to the issuer. Do not combine this flag with the -localauth flag. For more details, see bos(8). -localauth Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. The bos command interpreter presents the ticket to the BOS Server during mutual authentication. Do not combine this flag with the -cell or -noauth options. For more details, see bos(8). -help Prints the online help for this command. All other valid options are ignored. EXAMPLES
The following example removes all files from the /usr/lib/openafs directory on the machine "fs3.abc.com" that have a ".BAK" or ".OLD" extension. % bos prune -server fs3.abc.com -bak -old The following example removes all files from the /usr/lib/openafs directory on the machine "db2.abc.com" that have a ".BAK" or ".OLD" extension, and all files from the /var/log/openafs directory that have a "core." prefix. % bos prune -server db2.abc.com -all PRIVILEGE REQUIRED
The issuer must be listed in the /etc/openafs/server/UserList file on the machine named by the -server argument, or must be logged onto a server machine as the local superuser "root" if the -localauth flag is included. The bos prune command cannot be run against servers which are in restricted mode. SEE ALSO
KeyFile(5), UserList(5), bos(8), bos_getdate(8) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2012-03-26 BOS_PRUNE(8)
All times are GMT -4. The time now is 03:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy