06-02-2009
Copy files based on modification date
How to copy files from a location to a directory <YYMM> based on last modification date? This will need to run daily.
I want to copy those file for May to 0905 and Jun to 0906.
Appreciate your guidance.
![Smilie Smilie](https://www.unix.com/images/smilies/smile.gif)
Thanks.
-rw-rw-rw- 1 ttusr tgrp 4514 May 29 21:49 AB24279J.lot_a
-rw-rw-rw- 1 ttusr tgrp 4514 May 29 21:55 AB24279J_1.lot_a
-rw-rw-rw- 1 ttusr tgrp 1506921 Jun 1 20:40 AB24283J.hst_a
-rw-rw-rw- 1 ttusr tgrp 4283 Jun 1 20:40 AB24283J.lot_a
-rw-rw-rw- 1 ttusr tgrp 1506921 Jun 1 07:36 AB24285J.hst_a
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi. I need help my programing friends :p
I need to list all the files with a certain name (for example FileName) by last modification date but only the one with the last date. If there are two files with the same name and same modification date it should print the both.
For example in this set... (6 Replies)
Discussion started by: KitFisto
6 Replies
2. UNIX for Advanced & Expert Users
Hi,
I was very surprised to not be able to find an answer to this question despite my best efforts in Google and elsewhere. Maybe it's a good thing as it forced me to finally become a member in this great forum that i use frequently.
Ok my question:
I want to be able to sort files inside a... (3 Replies)
Discussion started by: stavros
3 Replies
3. Shell Programming and Scripting
Hi all
i am having so many files in my directory.Is there any option
to copy files based on date.
example
i am having file this
-rw-rw-r-- 1 ram user 1 Feb 2 17:12 abc
-rw-rw-r-- 1 ram user 1 Feb 2 17:12 bnw
-rwxrwxr-x 1 ram user 21122 Feb 4... (3 Replies)
Discussion started by: suryanarayana
3 Replies
4. Shell Programming and Scripting
Hi everyone,
I have files like file1_Mod.txt, file2_Mod.txt. I want to rename the old files with the last modification date. I write the below script to rename with current date, but I donīt know how to use "date -r" to get the last modification date with the same format I have below... (5 Replies)
Discussion started by: cgkmal
5 Replies
5. Shell Programming and Scripting
Hi All,
I need to list the files based modification time of the files from a directory, I cannot use "ls -t" as there are lot of files, which "ls" command cannot handle. New files will land there daily. So iam looking for an alternative through "find"command.
All suggestions are welcomed.
... (6 Replies)
Discussion started by: Kesavan
6 Replies
6. Shell Programming and Scripting
Hi, I have a requirement to copy files from a windows network drive to a Linux server using shell script based on the last created date.
Ex:
FileName CreatedDate/Time
F1 05-01-2012 3:00 PM
F2 05-01-2012 3:15 PM
F3 05-01-2012 2:00 PM
When i run the shell script... (1 Reply)
Discussion started by: Lee_10
1 Replies
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
Hi All,
I am new to shell srcipting.
Problem :
I need to write a script which copy the log files from /prod/logs directory based on todays date like (Jul 17) and place it to /home/hzjnr0 directory and then search the copied logfiles for the string "@ending successfully on Thu Jul 17". If... (2 Replies)
Discussion started by: mail.chiranjit
2 Replies
9. UNIX for Dummies Questions & Answers
Hi all,
i go a customer support requirement where i need to scan several files based on from/to date like 1-oct to 2-oct please help... (3 Replies)
Discussion started by: AbhiJ
3 Replies
10. Shell Programming and Scripting
Hi I have a problem, I have a large group of archive files in a folder some are later versions of the same archive, the only difference btween them is that the archiving program we use appends the name with a code for it to keep track of in its data base, and the modification date.
I am starting... (6 Replies)
Discussion started by: Paul Walker
6 Replies
LEARN ABOUT CENTOS
cracklib-format
cracklib-format(8) Debian GNU/Linux manual cracklib-format(8)
NAME
cracklib-format, cracklib-packer, cracklib-unpacker - cracklib dictionary utilities
SYNOPSIS
cracklib-format file ...
cracklib-packer cracklib_dictpath
cracklib-unpacker cracklib_dictpath
DESCRIPTION
cracklib-format takes a list of text files each containing a list of words, one per line, It lowercases all words, removes control charac-
ters, and sorts the lists. It outputs the cleaned up list to standard output. The text files may be optionally compressed with gzip(1).
If you supply massive amounts of text to cracklib-format you must have enough free space available for use by the sort(1) command. If you
do not have 20Mb free in /var/tmp (or whatever temporary area your sort(1) command uses), have a look at the /usr/sbin/cracklib-format pro-
gram which is a sh(1) program. You can usually tweak the sort(1) command to use any large area of disk you desire, by use of the -T
option. cracklib-format has a hook for this.
cracklib-packer reads from standard input a list of sorted and cleaned words and creates a database in the directory and prefix given by
the command line argument cracklib_dictpath. Three files are created with the suffixes of .hwm, .pwd, and .pwi. These three files are in
the format that the FascistCheck(3) subroutine, cracklib-unpacker(8), and cracklib-check(8), utilities understand. The number of words
read and written are printed on stdout(3).
cracklib-unpacker reads from the database in the directory and prefix given by the command line argument cracklib_dictpath and outputs on
standard output the list of words that make up the database.
The database is in a binary format generated by the utilities cracklib-format(8) and cracklib-packer(8). On a Debian system the database
is located in the directory /var/cache/cracklib/cracklib_dict and is generated daily with the program /etc/cron.daily/cracklib. The loca-
tion is also defined in the header file crack.h using the constant CRACKLIB_DICTPATH though none of the subroutines in the cracklib
libraries have this location hardcoded into their implementations.
FILES
/var/cache/cracklib/cracklib_dict.[hwm|pwd|pwi]
cracklib dictionary database files used by utilities.
/etc/cron.daily/cracklib
cracklib daily cron program to rebuild the cracklib dictionary database.
/etc/cracklib/cracklib.conf
cracklib configuration file used by the cracklib daily cron program to rebuild the cracklib dictionary database.
/usr/include/crack.h
cracklib header file defining the subroutine FascistCheck(3) and the constant CRACKLIB_DICTPATH used to compile in the location of
the cracklib dictionary database for these utilities.
/usr/sbin/cracklib-format
cracklib shell script to create initial list of words for dictionary database.
SEE ALSO
FascistCheck(3), cracklib-check(8), update-cracklib(8), create-cracklib-dict(8)
/usr/share/doc/libcrack2/libcrack2.html
/usr/share/doc/cracklib-runtime/cracklib-runtime.html
AUTHOR
cracklib2 is written by Alec Muffett <alecm@crypto.dircon.co.uk>. Manual added by Jean Pierre LeJacq <jplejacq@quoininc.com>.
2.7-8.5 Sat Jun 21 22:43:12 CEST 2008 cracklib-format(8)