Funny behaviour of copying/listing files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Funny behaviour of copying/listing files
# 1  
Old 08-07-2005
Funny behaviour of copying/listing files

Hi,

I encounter a very strange problem Smilie
Below is the code that i will run it to backup my files.
It will go to find all files in a particular folder from one date to another.
The start and end date is a fixed variable.

Example, my start date is 1st Jan 2005 and end date is 31st Jan 2005
Hence, it will pick up all the files in the folder within the date range and copy it to another folder.

Problem:
--------
For some reason, whenever i run it. It will always leave out some files(within the range)....
Hence, i will need to run it few times to be able to copy all of them Smilie

Quote:
....

# create 2 dummy files
touch -t $from_year$from_mon$from_day$t_hr$t_min.$t_sec $from_file
touch -t $to_year$to_mon$to_day$t_hr$t_min.$t_sec $to_file

find $OUTQUEUE -name \*.lst.* -newer $from_file ! -newer $to_file| while read LST_FILES;
do
cp -p $LST_FILES $FINAL_DIR
done
...
Anyone ever encounter this kind of problem?
# 2  
Old 08-08-2005
Are you getting 'No such file or directory errors' from cp?
# 3  
Old 08-09-2005
Quote:
Originally Posted by jim mcnamara
Are you getting 'No such file or directory errors' from cp?
nope Smilie
# 4  
Old 08-16-2005
anyone know why?
i am using AIX machine.
thanks!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

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

2. SuSE

Listing files

Hi, This may be silly for some of you guys, but please guide me, I have the followin fies in my directory, root@unix:/onlineredo/XTT77 : ls -l total 4129992 -rw------- 1 XTT77 XTT77 10493952 Jul 28 2010 S0106839.LOG -rw------- 1 XTT77 XTT77 10493952 Jul 28 2010 S0106840.LOG... (3 Replies)
Discussion started by: suren1829
3 Replies

3. UNIX for Advanced & Expert Users

Listing/copying files from magnetic optical disk

I am trying to list the name of files on an MOD - I use the command tar vtf /MOD_DRIVE|more and I get a nice list of filenames/directories on this particular MOD. When I put in another MOD that contains software options I get the error "directory checksum error". I would like to be able to... (2 Replies)
Discussion started by: drew_holm
2 Replies

4. Shell Programming and Scripting

perl script for listing files and mailing the all files

Hi, I am new to perl: I need to write perl script to list all the files present in directory and mail should be come to my inbox with all the files present in that directory. advanced thanks for valuable inputs. Thanks Prakash GR (1 Reply)
Discussion started by: prakash.gr
1 Replies

5. UNIX for Advanced & Expert Users

copying of files by userB, dir & files owned by userA

I am userB and have a dir /temp1 This dir is owned by me. How do I recursively copy files from another users's dir userA? I need to preserve the original user who created files, original group information, original create date, mod date etc. I tried cp -pr /home/userA/* . ... (2 Replies)
Discussion started by: Hangman2
2 Replies

6. UNIX for Dummies Questions & Answers

Listing files

Hi there! I would like to list all the files from a directory and its subdirectories. For example: DIRECTORY |- SUBDIR1 ||- sub1.txt ||- sub2.txt |- SUBDIR2 ||- sub3.txt |- root1.txt |- root2.txt I would like to create a fulllist.txt file which contains the list of these files (with... (2 Replies)
Discussion started by: bobix
2 Replies

7. UNIX for Advanced & Expert Users

listing files excluding files from control file

I have a directory named Project.I have a control file which contains valid list of files.I would like list the files from directory Project which contains files other than listed in the control file. Sample control file: TEST SEND SFFFILE CONTL The directory contains followign... (15 Replies)
Discussion started by: ukatru
15 Replies

8. Linux

Listing of files

How can I list all files in a directory and its subdirectories that have been created or changed since the system was booted. I was trying to acomplish this with "ls" and "find" commands but could not get anything usefull. Maybe some one can provide me a hint. Thank you for your time. (1 Reply)
Discussion started by: Vitalka
1 Replies

9. Filesystems, Disks and Memory

help - listing files

Hi, is there a way from the command line that I can list all files whose names are say 20 characters or more and direct the results into a file. I'm using RH9. thankx (2 Replies)
Discussion started by: richarmj
2 Replies

10. UNIX for Dummies Questions & Answers

Recursive directory listing without listing files

Does any one know how to get a recursive directory listing in long format (showing owner, group, permission etc) without listing the files contained in the directories. The following command also shows the files but I only want to see the directories. ls -lrtR * (4 Replies)
Discussion started by: psingh
4 Replies
Login or Register to Ask a Question