Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Renaming files to have date/time in filename Post 60608 by dangral on Wednesday 19th of January 2005 09:49:38 AM
Old 01-19-2005
Why not always have the script put the output in a datestamped file?

For example:

Code:
#!/bin/ksh
SCRIPT=$(basename ${0})
LOG="${SCRIPT}_`date +%m%d%y%H%M%S`


command1 >> $LOG 2>&1
command2 >> $LOG 2>&1

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Insert date/time within a filename

Hi Guys, I need to script the renaming of files as followins: files: firstjd secondjo thirdjv My script needs to insert the date/time infront of the last 2 characters of the filenames above, any ideas greatly received :) the letters before the last 2 characters could change, I'm only... (7 Replies)
Discussion started by: cooperman
7 Replies

2. UNIX for Advanced & Expert Users

find formatted filename with date time

Hi, I operate and use HF radars along the California coast for ocean surface currents. The devices use Mac OS as the control and logging software. The software generates thousands of files a week and while I've used PERL in the past to solve the problems of finding files I come to realize some... (6 Replies)
Discussion started by: dpath2o
6 Replies

3. Shell Programming and Scripting

Finding files older than the current date and time and renaming and moving

Hi, I have a very urgent requirement here. I have to find all files in the specified directory but not in the sub directories(The directory name is stored in a variable) which are older than the current date as well as current time and rename it as filename_yyyymmddhhmmss.ext and move it into a... (7 Replies)
Discussion started by: ragavhere
7 Replies

4. UNIX for Dummies Questions & Answers

Shell Scripts - Append a filename with date and time....

Hello, I need to create a shell script that appends a filename to create a name with the date and time appended that is guaranteed to not exist. That is, the script insures you will not overwrite a file with the same name. I am lost with this one. I know I need to use date but after that I am... (3 Replies)
Discussion started by: citizencro
3 Replies

5. Shell Programming and Scripting

append a filename with system date and time

Hi, There are similar kind of posts, but none seems like working for me. Please correct me if I'm wrong. I need append/rename file abc.txt with file processed date and time like abc_systemdatetimestamp.txt and move it to different folder. for example I have /source/data/abc.txt ... (1 Reply)
Discussion started by: amsn08
1 Replies

6. Shell Programming and Scripting

Renaming multiple files at once (discarding suffix of the filename after a character)

Hi, I have a lot of files similar to the below order. I want to rename all the files .discrading the time stamp/numbers after cnf. Existing files id_info_20130405.cnf_20130801 in_info_20130405.cnf_20130891 iz_info_20130405.cnf_20130821 in_info_20130405.cnf_20130818... (2 Replies)
Discussion started by: saravanapandi
2 Replies

7. Shell Programming and Scripting

Validate date and time in filename by awk

hi i want to validate the date and time in filename filename : mohan.moh.ccyymmdd.ccyymmdd.hhmmss.txt mohan_moh.20151222.20151222.122442.txt i want code that check that date given in filename 20151222 in this format ccyymmdd else it mark file is not valid used in my OS detail is AIX 6... (12 Replies)
Discussion started by: MOHANP12
12 Replies

8. UNIX for Beginners Questions & Answers

How to extract date and time from filename?

Hi, I'm totally new in sell script and working with a shell code. I want to extract the date and time from the filenames. The filenames are different but all of them begins with WI_ SCOPE_: WI_SCOPE_DATA_CHANGE_2017-09-12_15-30-40.txt WI_SCOPE_BACK_COMPLETE_QUEUE_2017-09-12_15-31-40.txt... (5 Replies)
Discussion started by: Home
5 Replies

9. UNIX for Beginners Questions & Answers

Renaming files by appending string from within file to filename

Greetings. I am working in a Linux environment and am trying to figure out a way to rename files in a directory by appending a unique strings that appears within a certain area in those files. I have gotten as far as identifying what that particular unique string is with a command like the... (10 Replies)
Discussion started by: HLee1981
10 Replies

10. UNIX for Beginners Questions & Answers

Extract date and time part from filename

Hi, I am facing one scenario in which I need to extract exact position of date and time from the name of the files. For example, Below is the record in which I need to extract position of YYYYMMDD,HHMISS and YYMMDD. Date and time variables can come more than once. I need to use these position... (13 Replies)
Discussion started by: Prathmesh
13 Replies
condor_preen(1) 					      General Commands Manual						   condor_preen(1)

Name
       condor_preen remove - extraneous files from Condor directories

Synopsis
       condor_preen [-mail] [-remove] [-verbose]

Description
       condor_preenexamines  the  directories belonging to Condor, and removes extraneous files and directories which may be left over from Condor
       processes which terminated abnormally either due to internal errors or a system crash. The directories checked are the  LOG  ,	EXECUTE  ,
       and   SPOOL directories as defined in the Condor configuration files. condor_preenis intended to be run as user	root or user  condor peri-
       odically as a backup method to ensure reasonable file system cleanliness in the face of errors. This is done automatically  by  default	by
       the condor_masterdaemon. It may also be explicitly invoked on an as needed basis.

       When  condor_preencleans the  SPOOL directory, it always leaves behind the files specified in the configuration variable  VALID_SPOOL_FILES
       as given by the configuration. For the  LOG directory, the only files removed or reported are those listed within the  configuration  vari-
       able   INVALID_LOG_FILES  list. The reason for this difference is that, in general, the files in the  LOG directory ought to be left alone,
       with few exceptions. An example of exceptions are core files. As there are new log files introduced regularly, it is less effort to specify
       those that ought to be removed than those that are not to be removed.

Options
       -mail

	  Send mail to the user defined in the	PREEN_ADMIN configuration variable, instead of writing to the standard output.

       -remove

	  Remove the offending files and directories rather than reporting on them.

       -verbose

	  List all files found in the Condor directories, even those which are not considered extraneous.

Exit Status
       condor_preenwill exit with a status value of 0 (zero) upon success, and it will exit with the value 1 (one) upon failure.

Author
       Condor Team, University of Wisconsin-Madison

Copyright
       Copyright  (C)  1990-2012  Condor  Team,  Computer  Sciences Department, University of Wisconsin-Madison, Madison, WI. All Rights Reserved.
       Licensed under the Apache License, Version 2.0.

       See the Condor Version 7.8.2 Manualor http://www.condorproject.org/licensefor additional notices. condor-admin@cs.wisc.edu

								  September 2012						   condor_preen(1)
All times are GMT -4. The time now is 07:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy