Sponsored Content
Top Forums Shell Programming and Scripting Select only the files created in the last 24 hours Post 302530363 by jimbojames on Monday 13th of June 2011 10:59:48 PM
Old 06-13-2011
Select only the files created in the last 24 hours

Hi There

I am trying to create a shell script (.ksh) that will be run on AIX 5300-10 to scp files from one server to another.

The only files I am interested in are the ones that were created in the last 24 hours of whenever the script was run. There are numerous other files in the source directory that were created some time ago, and I do not want to copy these.

Does anybody have ideas on how this can be achieved? I know there is the find command that I can use, but I do not know if this caters for what I require.

Thank you
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

delete files that are over 2 hours old

guys, I have a need for a script that will delete all files in a given directory that are over 2 hours old. I will set this up to run in cron. I'm having a little trouble coming up with the syntax that will identify these files. Is there a variation of the ls command that I can use to identify... (3 Replies)
Discussion started by: hedrict
3 Replies

2. Shell Programming and Scripting

Files created in last 24 hours

I need a script which list the files which is starting with the word heap*** and that is created before past 24 hours.I need the script using find command. please help me on this. (1 Reply)
Discussion started by: jayaramanit
1 Replies

3. Shell Programming and Scripting

list the file created before 24 hours using ls command

I want to list the files created before past 24 hours using ls command. please help me on this (7 Replies)
Discussion started by: jayaramanit
7 Replies

4. UNIX for Dummies Questions & Answers

Finding a file created within the last 24 hours

which out of atime, ctime, or mtime are the closest to diplaying only the files created within the last 24 hours. is it even possible to find only the files created in the last 24 hours, because I heard that unix files don't hold the creation time as a property of the file. (3 Replies)
Discussion started by: raidkridley
3 Replies

5. Shell Programming and Scripting

How to find files by hours old?

I need to be able to do the following: Find files in multiple directories that are 6 hours older than the current time? I am using KSH I tried mmtime but it was not a valid option Any help would be great. Thank you! (2 Replies)
Discussion started by: llsmr777
2 Replies

6. Shell Programming and Scripting

how to list files between last 6 hours to 3 hours

Hi Frens, I want to list some files from a directory, which contains "DONE" in their name, i am receiving files every minute. In this i want to list all the files which are newer than 6 hours but older than 3 hours, of current time i dont want my list to contain the latest files which are ... (4 Replies)
Discussion started by: Prat007
4 Replies

7. Shell Programming and Scripting

Check file created is less than 4 hours or not.

Hi, I need to check some files in one directory whether any files has been created before 4 hours(ie, less than 4 hours from the current time). Can anybody help me out..? Thanks in advance..! (21 Replies)
Discussion started by: Kattoor
21 Replies

8. Shell Programming and Scripting

files older than few hours

Hi All I need to know the command which can be used to list the files which are 3 hours old so that it can be deleted. (3 Replies)
Discussion started by: mskalyani9
3 Replies

9. Shell Programming and Scripting

Get filelist in a folder which is created in last x hours

Hi , I am looking for some help in getting the list of files matching some pattern in a folder and those were created in last X hours. Please help. Thanks in advance. (1 Reply)
Discussion started by: Anupam_Halder
1 Replies

10. Shell Programming and Scripting

Listing the file name and no of records in each files for the files created on a specific day

Hi, I want to display the file names and the record count for the files in the 2nd column for the files created today. i have written the below command which is listing the file names. but while piping the above command to the wc -l command its not working for me. ls -l... (5 Replies)
Discussion started by: Showdown
5 Replies
DCMD(1)                                                       General Commands Manual                                                      DCMD(1)

NAME
dcmd - expand file lists of .dsc/.changes files in the command line SYNOPSIS
dcmd [options] [command] [changes-file|dsc-file] [...] DESCRIPTION
dcmd replaces any reference to a .dsc or .changes file in the command line with the list of files in its 'Files' section, plus the file itself. It allows easy manipulation of all the files involved in an upload (for changes files) or a source package (for dsc files). If command is omitted (that is the first argument is an existing .dsc or .changes file), the expanded list of files is printed to stdout, one file by line. Useful for usage in backticks. OPTIONS
There are a number of options which may be used in order to select only a subset of the files listed in the .dsc or .changes file. If a requested file is not found, an error message will be printed. --dsc Select the .dsc file. --schanges Select .changes files for the 'source' architecture. --bchanges Select .changes files for binary architectures. --changes Select .changes files. Implies --schanges and --bchanges. --archdeb Select architecture-dependent binary packages (.deb files). --indepdeb Select architecture-independent binary packages (.deb files). --deb Select binary packages (.deb files). Implies --archdeb and --indepdeb. --archudeb Select architecture-dependent udeb binary packages. --indepudeb Select architecture-independent udeb binary packages. --udeb Select udeb binary packages. Implies --archudeb and --indepudeb. --tar, --orig Select the tar file. --diff Select the Debian diff file. Each option may be prefixed by --no to indicate that all files not matching the specification should be selected. It is not possible to combine positive filtering options (e.g. --dsc) and negative filtering options (e.g. --no-changes) in the same dcmd invocation. --no-fail-on-missing, -r If any of the requested files were not found, do not output an error. EXAMPLES
Copy the result of a build to another machine: $ dcmd scp rcs_5.7-23_amd64.changes elegiac:/tmp rcs_5.7-23.dsc 100% 490 0.5KB/s 00:00 rcs_5.7-23.diff.gz 100% 12KB 11.7KB/s 00:00 rcs_5.7-23_amd64.deb 100% 363KB 362.7KB/s 00:00 rcs_5.7-23_amd64.changes 100% 1095 1.1KB/s 00:00 $ $ dcmd --diff --deb scp rcs_5.7-23_amd64.changes elegiac:/tmp rcs_5.7-23.diff.gz 100% 12KB 11.7KB/s 00:00 rcs_5.7-23_amd64.deb 100% 363KB 362.7KB/s 00:00 $ Check the contents of a source package: $ dcmd md5sum rcs_5.7-23.dsc 8fd09ea9654cda128f8d5c337d3b8de7 rcs_5.7.orig.tar.gz f0ceeae96603e823eacba6721a30b5c7 rcs_5.7-23.diff.gz 5241db1e231b1f43ae5514b63d2523f8 rcs_5.7-23.dsc $ $ dcmd --no-diff md5sum rcs_5.7-23.dsc 8fd09ea9654cda128f8d5c337d3b8de7 rcs_5.7.orig.tar.gz 5241db1e231b1f43ae5514b63d2523f8 rcs_5.7-23.dsc $ SEE ALSO
dpkg-source(1), dpkg-genchanges(1). AUTHOR
This program was written by Romain Francoise <rfrancoise@debian.org> and is released under the GPL, version 2 or later. DEBIAN Debian Utilities DCMD(1)
All times are GMT -4. The time now is 11:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy