Sponsored Content
Full Discussion: Copy files based on date
Top Forums Shell Programming and Scripting Copy files based on date Post 302392372 by suryanarayana on Thursday 4th of February 2010 08:08:54 AM
Old 02-04-2010
Copy files based on date

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 10:50 cdq
-rwxrwxr-x 1 ram user 22928 Feb 4 10:50 new

i want copy abc,bnw files to one directory and cdq,new to another directory.

Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. HP-UX

copy files with date

Hi, I have a coupel of files in /tmp which I have to copy to /var. But I want their name to be same as the source with date suffix. But the problem is I don;t know the prefix of the file, I only know the suffix of file. AAA.997 ABC.997 ADC.997 The later part 997 is constant but the... (1 Reply)
Discussion started by: isingh786
1 Replies

2. Shell Programming and Scripting

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.:) Thanks. -rw-rw-rw- 1 ttusr tgrp 4514 May 29 21:49 AB24279J.lot_a... (17 Replies)
Discussion started by: KhawHL
17 Replies

3. Shell Programming and Scripting

copy files based on creation timestamp

Dear friends.. I have the below listing of files under a directory in unix -rw-r--r-- 1 abc abc 263349631 Jun 1 11:18 CDLD_20110603032055.xml -rw-r--r-- 1 abc abc 267918241 Jun 1 11:21 CDLD_20110603032104.xml -rw-r--r-- 1 abc abc 257672513 Jun 3 10:41... (5 Replies)
Discussion started by: sureshg_sampat
5 Replies

4. Shell Programming and Scripting

Copy files based on last created date

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

5. UNIX for Dummies Questions & Answers

Script to copy files from a certain date

I need to copy files from a directory that has a lot of files in it. However I only want to copy them from a certain date. My thoughts so far are to use ls -l and to pipe this into awk and print out tokens 6 (month)and 7 (day). $ ls -l -rw-r--r-- 1 prodqual tst 681883 Jun 12... (2 Replies)
Discussion started by: millsy5
2 Replies

6. Shell Programming and Scripting

Find and copy files based on todays date and search for a particular string

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

7. Shell Programming and Scripting

How to copy files from one location to another based on a priority?

Hi Gurus, I am a newbie to shell scripting and I am facing a problem right now.I have to automate the copy of files based on a priority.The scenario is as below: 1) There will be files from Mon-Fri with Mon file being named as abc_def_01_YYYYMMDD and Tue file being abc_def_02_YYYYMMDD and so... (4 Replies)
Discussion started by: vikramgk9
4 Replies

8. UNIX for Dummies Questions & Answers

Copy log based on from-date and to-date

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

9. 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

10. UNIX for Beginners Questions & Answers

Find and copy .zip file based on today's date

Hi Team, I'm new to unix and i have a requirement to copy or move files from one directory to another based on current date mentioned in the .zip file name. Note that i need to copy only the recent zip file. please help me with the code i tried the code as: #! /usr/bin/sh find... (3 Replies)
Discussion started by: midhun3108
3 Replies
PACKAGE(1)						      General Commands Manual							PACKAGE(1)

NAME
package - register package user via mailagent SYNOPSIS
package address system version patchlevel [ mailpatches | notifypatches ] DESCRIPTION
This command is not intended to be run directly by a user, but may appear in any mail whose subject is set to Command. Such mail will be processed by the mailagent(1), which will extract all lines beginning with @SH, which may specify this command. The mailagent first sets environment variables that will be used by the command. Package is used to notify the author of a package about its users. It is normally generated automatically by the MailAuthor.U unit when the user runs Configure. If the patchlevel specified is not the latest for that system and version, mail is immediately sent suggesting that they upgrade and remindng them how to request the latest patches. The final parameter, if included may be set to mailpatches to specify that the user would like to have future patches mailed to them, or notifypatches to specify that a mail notification of future patches should be sent, rather than the entire patch. The user's address and notification request are saved in the file users in the package's directory. Package performs an approximate address match in order to avoid duplicate entries. Whenever this elimination occurs, a warning message is issued in the logfile. Two addresses will be said equivalent if one of them has an added machine name or if they are really equal. There- fore, the following addresses are equivalent: ram@acri.fr ram@main.acri.fr whereas the following two are not equivalent, unfortunately: ram@acri.acri.fr ram@main.acri.fr When a user is asking to be left alone, it is important to let him know if the request failed, because he will be annoyed when the next set of patches is issued and he still gets them despite his previous request. Therefore, if no approximate match occurs, a warning message is sent back, with a list of addresses that are close to his own e-mail address, but not equivalent. Fortunately, the following addresses are considered close: ram@acri.fr ram@somewhere.com raphael@main.acri.fr manfredi@acri.acri.fr because they either have the same login (important when someone changes company) or share the same domain or sub-domain part. In order to edit the users file, the edusers script should be used. For one thing, it will let you edit the users file from whatever pack- age you name in the command line, but it will also properly lock the file so that the execution of package will stall for the duration of the manual edition (provided you have a strict locking policy defined in your ~/.mailagent configuration file). FORWARDING
Package supports command forwarding as described in the mailhelp(1) page. FILES
~/.mailagent configuration file for mailagent. System/users list of users of that system. This file consists of single line records, one for each registered user. Each record consists of three tab-separated fields. The first field indicates the level of updates requested by the user by a single letter as follows: M Mail future patches directly to the user when they are issued. N Notify the user of future patches. U The users chose to let the author know that they have tried the program, but does not wish to know about future updates. L The user is no longer interested in the program and wants to be left alone. The second field is their last notified patch level, or a dash (-) if it is not known. The third field is the user's Email address. Log/agentlog mailagent's log file AUTHORS
Graham Stoney <greyham@research.canon.oz.au> Raphael Manfredi <Raphael_Manfredi@pobox.com> (minor enhancements) SEE ALSO
edusers(1), mailagent(1), metaconfig(1). PACKAGE(1)
All times are GMT -4. The time now is 11:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy