Sponsored Content
Homework and Emergencies Emergency UNIX and Linux Support How to move files from a directory which falls between Date Range? Post 302645511 by jim mcnamara on Wednesday 23rd of May 2012 03:24:30 PM
Old 05-23-2012
do the dates reflect the file mtime? If so
Code:
touch -t 201205160000 /tmp/dummy
cd /old_directory
find . -type f -name '*zip*'  -newer  /tmp/dummy |
while read fname 
do
#test
  echo " $fname will become /new_directory/$fname
#real
#  mv $fname  /new_directory/$fname
done

See the #real part? run the code as is to verify if this is what you want. It is harmless. Do this FIRST.

If OK: Then edit the script and remove the # in front of the word mv
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Move all files in a directory tree to a signal directory?

Is this possible? Let me know If I need specify further on what I am trying to do- I just want to spare you the boring details of my personal file management. Thanks in advance- Brian- (2 Replies)
Discussion started by: briandanielz
2 Replies

2. Shell Programming and Scripting

Need script to select multiple files from archive directory based on the date range

hi all, here is the description to my problem. input parameters: $date1 & $date2 based on the range i need to select the archived files from the archived directory and moved them in to working directory. can u please help me in writing the code to select the multiple files based on the... (3 Replies)
Discussion started by: bbc17484
3 Replies

3. Shell Programming and Scripting

Grep by range of date from file creation in directory

Hi Expert, Need your scripting and finding data so that it help me to find the culprit of this memory usage error. Data provided here is a sample. Process Snapshot directory: /var/spool/processes-snapshot webdev9o9% pwd /var/spool/processes-snapshot webdev9o9% ls -lrct -rw-r--r-- ... (3 Replies)
Discussion started by: regmaster
3 Replies

4. Shell Programming and Scripting

Script to move files to a directory according to date

hi all, here is the description to my problem. input parameter: $date1 based on the date i need to select three files starting with audit.log* based on its modified date, a date before, a date after(if its exists). We need to compare the input date to modified date of the file. And then... (3 Replies)
Discussion started by: ashrocks
3 Replies

5. Shell Programming and Scripting

Move files from one directory to another based on creation/modification date

Hi All, Really stuck up with a requirement where I need to move a file (Lets say date_Employee.txt--the date will have different date values like 20120612/20120613 etc) from one directory to another based on creation/modification dates. While visiting couple of posts, i could see we can... (3 Replies)
Discussion started by: dsfreddie
3 Replies

6. UNIX for Dummies Questions & Answers

Extracting rows from a text file if the value of a column falls between a certain range

Hi, I have a file that looks like the following: 10 100080417 rs7915867 ILMN_1343295 12 6243093 7747537 10 100190264 rs2296431 ILMN_1343295 12 6643093 6647537 10 100719451 SNP94374 ILMN_1343295 12 6688093 7599537 ... (1 Reply)
Discussion started by: evelibertine
1 Replies

7. UNIX for Dummies Questions & Answers

Find the count of files by last created date based on the given date range

My unix version is IBM AIX Version 6.1 I tried google my requirement and found the below answer, find . -newermt “2012-06-15 08:13" ! -newermt “2012-06-15 18:20" But newer command is not working in AIX version 6.1 unix I have given my requirement below: Input: atr files: ... (1 Reply)
Discussion started by: yuvaa27
1 Replies

8. Shell Programming and Scripting

List files with date, create directory, move to the created directory

Hi all, i have a folder, with tons of files containing as following, on /my/folder/jobs/ some_name_2016-01-17-22-38-58_some name_0_0.zip.done some_name_2016-01-17-22-40-30_some name_0_0.zip.done some_name_2016-01-17-22-48-50_some name_0_0.zip.done and these can be lots of similar files,... (6 Replies)
Discussion started by: charli1
6 Replies

9. UNIX for Dummies Questions & Answers

How to move gz files from one source directory to destination directory?

Hi All, Daily i am doing the house keeping in one of my server and manually moving the files which were older than 90 days and moving to destination folder. using the find command . Could you please assist me how to put the automation using the shell script . ... (11 Replies)
Discussion started by: venkat918
11 Replies
bart_manifest(4)						   File Formats 						  bart_manifest(4)

NAME
bart_manifest - system audit manifest file DESCRIPTION
The bart(1M) command generates a manifest that describes the contents of a managed host. A manifest consists of a header and entries. Each entry represents a single file. Entries are sorted in ascending order by file name. Any nonstandard file names, such as those that contain embedded newline or tab characters, have the special characters quoted prior to being sorted. See Quoting Syntax. Lines that begin with ! supply metadata about the manifest. The manifest version line indicates the manifest specification version. The date line shows the date on which the manifest was created, in date(1) form. Some lines are ignored by the manifest comparison tool. Ignored lines include blank lines, lines that consist only of white space, and com- ments that begin with #. In addition to metadata lines, the header contains the format comment block. This comment block lists the attributes reported for each file type. To see the format of a manifest file, see EXAMPLES. Manifest File Entries Each manifest file entry is a single line of one of the following forms, depending on the file type: fname D size mode acl dirmtime uid gid fname P size mode acl mtime uid gid fname S size mode acl mtime uid gid fname F size mode acl mtime uid gid contents fname L size mode acl lnmtime uid gid dest fname B size mode acl mtime uid gid devnode fname C size mode acl mtime uid gid devnode The fields of the manifest file entries are described as follows: fname Name of the file. To prevent parsing problems that are caused by special characters embedded in file names, file names are encoded as described in Quoting Syntax. type Type of file. Possible values for type are as follows: B Block device node C Character device node D Directory F File L Symbolic link P Pipe S Socket size File size in bytes. mode Octal number that represents the permissions of the file. acl ACL attributes for the file. For a file with ACL attributes, this field contains the output from aclto- text(). uid Numerical user ID of the owner of this entry. gid Numerical group ID of the owner of this entry. dirmtime Modification time in seconds since 00:00:00 UTC, January 1, 1970 for directories. lnmtime Creation time for links. mtime Modification time in seconds since 00:00:00 UTC, January 1, 1970 for files. contents Checksum value of the file. This attribute is only specified for regular files. If you turn off context checking or if checksums cannot be computed, the value of this field is -. dest Destination of a symbolic link. devnode Value of the device node. This attribute is for character device files and block device files only. Quoting Syntax The rules file supports a quoting syntax for representing nonstandard file names. When generating a manifest for file names that embeded <TAB>, <SPACE>, or <NEWLINE> characters, the special characters are encoded in their octal forms. +-----------------------------+-----------------------------+ |Input Character |Quoted Character | +-----------------------------+-----------------------------+ |<SPACE> |<SPACE> | +-----------------------------+-----------------------------+ |<TAB> |<TAB> | +-----------------------------+-----------------------------+ |<NEWLINE> |<NEWLINE> | +-----------------------------+-----------------------------+ |? |? | +-----------------------------+-----------------------------+ |[ |[ | +-----------------------------+-----------------------------+ |* |* | +-----------------------------+-----------------------------+ EXAMPLES
Example 1: Sample Manifest File The following is a sample system manifest file. The file entries are sorted by the encoded versions of the file names to correctly handle special characters. ! Version 1.0 ! Mon Feb 11 10:55:30 2002 # Format: # fname D size mode acl dirmtime uid gid # fname P size mode acl mtime uid gid # fname S size mode acl mtime uid gid # fname F size mode acl mtime uid gid contents # fname L size mode acl lnmtime uid gid dest # fname B size mode acl mtime uid gid devnode # fname C size mode acl mtime uid gid devnode /etc D 3584 40755 user::rwx,group::r-x,mask::r-x,other::r-x, 3c6803d7 0 3 /etc/.login F 524 100644 user::rw-,group::r--,mask::r--,other::r--, 3c165878 0 3 27b53d5c3e844af3306f1f12b330b318 /etc/.pwd.lock F 0 100600 user::rw-,group::---,mask::---,other::---, 3c166121 0 0 d41d8cd98f00b204e9800998ecf8427e /etc/.syslog_door L 20 120777 user::rw-,group::r--,mask::rwx,other::r--, 3c6803d5 0 0 /var/run/syslog_door /etc/autopush L 16 120777 user::r-x,group::r-x,mask::r-x,other::r-x, 3c165863 0 0 ../sbin/autopush /etc/cron.d/FIFO P 0 10600 user::rw-,group::---,mask::---,other::---, 3c6803d5 0 0 SEE ALSO
date(1), bart(1M), bart_rules(4), attributes(5) SunOS 5.10 9 Sep 2003 bart_manifest(4)
All times are GMT -4. The time now is 12:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy