12-01-2005
hmm tcsh, tough, i didnt ever use it.
If you want to go with ksh tho, i ll use something like this
=================
tgt is the target dir
for i in *
do
newf=`find . -name $i -newer "../tgt/$i"`
if [ "x$newf" != "x" ]
then
cp $newf ../tgt/$i
fi
done
hope this gives you some pointers
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I have the following question :
As far as I know unix doesn't store file creation dates.
Would that imply the following?
tar -cvzf backup.tar --newer
is equal to:
tar -cvzf backup.tar --newer-mtime ? (1 Reply)
Discussion started by: jamesbond
1 Replies
2. UNIX for Dummies Questions & Answers
Is there a way to use the find command to locate files newer than a specific date?
Thanks!
--Alex (4 Replies)
Discussion started by: vertigo23
4 Replies
3. Solaris
Dear all,
Can you help me in copying files newer than speciifc date
Thanks in advance,
Rajesh (3 Replies)
Discussion started by: RAJESHKANNA
3 Replies
4. UNIX and Linux Applications
I have tried winscp, filezilla to copy data from windows xp SP2 machine to the sun sparc unix machine. However speed is around 120 to 130 kb/sec. I do have lot of files & with large size.
So I switched to windows command prompt & transfered few files using sftp command. Its very fast as compared... (0 Replies)
Discussion started by: _prasad
0 Replies
5. Shell Programming and Scripting
Actually i want to copy some file locations to another. so if directory not exist it should create that.
i used cp -R/r but it copies only one directory. it doesnt make directory inside directory..
so i want this should create them automatically.
One more thing if file already exist there... (8 Replies)
Discussion started by: ajayyadavmca
8 Replies
6. Shell Programming and Scripting
I want the same effect as "cp -u" but without create missing files, it is possible ?
ps: bash (2 Replies)
Discussion started by: mrxrsd
2 Replies
7. Solaris
Hello everyone. Need some help copying a filesystem. The situation is this: I have an oracle DB mounted on /u01 and need to copy it to /u02. /u01 is 500 Gb and /u02 is 300 Gb. The size used on /u01 is 187 Gb. This is running on solaris 9 and both filesystems are UFS.
I have tried to do it using:... (14 Replies)
Discussion started by: dragonov7
14 Replies
8. UNIX for Dummies Questions & Answers
We had an arrant rsync run and started copying over new files from one system to another.
Although this is what we will want to do at some point, for now, we want to maintain the system as it was a few days ago.
I am looking for a script that will find files that are newer than x days.
... (5 Replies)
Discussion started by: Leyva62
5 Replies
9. Shell Programming and Scripting
How do I list al files in a folder with a creation date/time newer than 6 hours? (2 Replies)
Discussion started by: locoroco
2 Replies
10. Shell Programming and Scripting
I only want the file copied if it is newer. But it still copies the file?
zip -u Ubuntu_Documents.zip ./*
cp -u Ubuntu_Documents.zip $DOCS_Backup/Ubuntu_Documents_`date +"%Y-%m-%d-%H-%M"`.zip (5 Replies)
Discussion started by: drew77
5 Replies
mcopy(1) General Commands Manual mcopy(1)
NAME
mcopy - mtools utility to copy DOS files to and from a UNIX operating system
SYNOPSIS
mcopy [-mntv] sourcefile targetfile
mcopy [-mntv] sourcefile [sourcefiles...] targetdirectory
OPTIONS
Preserves the file modification time. Specifies that a warning is not issued when an existing file is specified as the target file. If
this option is not specified, the mcopy command verifies whether or not to overwrite an existing file. Specifies a text file transfer.
Line terminators are converted to the appropriate format. Specifies verbose mode. The new file name is displayed if the name supplied is
invalid.
DESCRIPTION
The mcopy command copies the specified file to the named file, or copies multiple files to the named directory. The specified files or
directories can be either DOS or UNIX files.
If the file is a text file line terminators are converted to the appropriate format.
Using a drive letter designation on the DOS files such as 'a:' determines the direction of the transfer. A missing drive designation indi-
cates a UNIX file whose path starts in the current directory.
DOS subdirectory names that contain the '/' or '' separator are supported. If you use the '' separator or wildcards, you must enclose
file names in quotes to protect them from the shell.
The mcd command can be used to establish the device and the current working directory (relative to DOS), otherwise the default is A:.
Not all UNIX file names are supported in the DOS world. The mcopy command may have to change UNIX names to fit the DOS file name conven-
tions. The following table shows some examples of file name conversions:
-----------------------------------------------
UNIX name DOS name Reason for the change
-----------------------------------------------
thisisatest THISISAT file name too long
file.stuff FILE.STU extension too long
prn.txt XRN.TXT PRN is a device name
.abc X.ABC null file name
hot+cold HOTXCOLD illegal character
-----------------------------------------------
RESTRICTIONS
The following restrictions exist: Omitting the destination directory is not supported. Using the plus (+) operator is not supported.
Using a drive letter designation on DOS files is required with this command only, not with other mtools.
EXIT STATUS
The following exit values are returned: Success. Failure.
ENVIRONMENT VARIABLES
The following environment variables affect the execution of mcopy: If set, this variable names the file that contains the name of the cur-
rent mtools working directory as established by the mcd command. If this variable is not set, the file $HOME/.mcwd is used.
FILES
Contains the name of the current mtools working directory as established by the mcd command. If this file does not exist, the default
mtools working directory is A:. Executable file
SEE ALSO
Commands: dos2unix(1), mcd(1), mdiskcopy(1), mread(1), mtools(1), mwrite(1), unix2dos(1)
mcopy(1)