11-22-2009
Copy/move file which are not currently in use.
Hello experts,
I'm doing a shell script that able to copy or move files.
My situation is i have a drive ( lets say its S drive) where its receive all the files from mainframe
i need to copy all the file from S drive to T drive. but only those files that are finished copied from mainframe and not in use by other applications.
- i need to check it and
- i need to create the log files for every copy or move process.
my coding look like this
cd /cygdrive/s/Files
for FILES in ./*.*
do
temp=`basename $FILES`
echo "$temp ">> /cygdrive/s/LogFiles/OriginalFiles.rtf
#Copy files from S drive to T drive
cp $FILES /cygdrive/t/CopyFile1/$FILES
done
unset temp
But the coding above takes all the files that's currently in use and copying files into log.
Anyone can help me in this???
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have created a folder on C:\images\Raffles.jpg on my PC, and I like to copy or move to Solaris server. How can I do that?
Please advise.
Thanks in advance. (2 Replies)
Discussion started by: simt
2 Replies
2. Shell Programming and Scripting
Hello Gurus!
Please help!
I would like to get some help with the following:
I'm working right now on a Data Warehouse project and I need to automate a manual procedure I am using to process the data files coming into the database, any information/ideas and or which script language to go... (4 Replies)
Discussion started by: alfpathros
4 Replies
3. Shell Programming and Scripting
Hi,
i have made this script for copy file in folder FTP in my local machine, when copy is finish i move files copied in backups_001 directory on same ftp
1°) the problem is if this script works with date if date is similar i taken, but if one day in ftp they put new file is no getting
... (0 Replies)
Discussion started by: livetele
0 Replies
4. Shell Programming and Scripting
Hello,
I made a script to copy files from one directory to another and move file after the copy is done. When files are present in the source directory there is no problem but when no file are present I'm getting an error.
Please help !!
---------------------
#!/bin/bash
... (2 Replies)
Discussion started by: lsimoneau
2 Replies
5. UNIX for Dummies Questions & Answers
I am trying to create files with special characters in its filenames for testing purposes. This is on a Linux RHEL4 but this should also be applicable on a Unix shell.
I am able to create files with special characters in the filenames...e.g.
cp -pv foo.gif \*special.gif
cp -pv foo.gif \... (6 Replies)
Discussion started by: sqa777
6 Replies
6. UNIX for Dummies Questions & Answers
Help please...
Need to convert below:
Subcase ID : 10001
210000 0 1.22049E+01
220000 0 6.29560E+00
Subcase ID : 20703
210000 0 2.76398E+00
220000 0 2.43183E+00
230000 0 -1.87728E+01
Subcase ID : 13703
210000 0 ... (2 Replies)
Discussion started by: lakanino
2 Replies
7. UNIX for Dummies Questions & Answers
I am trying to move a file that is in the root directory. I suspect it is an old file created by someone when the system was installed. I am testing accessing the file by doing a copy but the command does not find the file.
I am operating as root. We are HP-UX B.11.23
I do long listing and... (3 Replies)
Discussion started by: phcorn
3 Replies
8. Shell Programming and Scripting
Hi All,
I have a simple shell script to move .txt file(s) from a source directory one after another to the destination. The source directory is shared to windows using samba. The source files are arriving continuously and approx size is 10-15 KB. Some time the file size reached upto 100 KB and... (9 Replies)
Discussion started by: sraj142
9 Replies
9. Solaris
Hey everyone!. I have a problem with a file that doesn't allow any operation on it. I can't rm,mv,cp nor any other operation to it, I get the following errors:
bash-2.05# mv ora_2527.aud /bkp
mv: cannot access ora_2527.aud
bash-2.05# cp ora_2527.aud /bkp
cp: cannot access ora_2527.aud... (4 Replies)
Discussion started by: dragonov7
4 Replies
10. Red Hat
Hi all,
I'm Using Centos 6.4
/opt/my_aplication/entry/data/0/
There are Thousands of files in this Directory, Only i need to copy or move the apache User's file from this to /tmp/backup , I have listed apache user's file using find . -user apache -type f , its gave me the only apache... (2 Replies)
Discussion started by: babinlonston
2 Replies
LEARN ABOUT HPUX
volcheck
volcheck(1) User Commands volcheck(1)
NAME
volcheck - checks for media in a drive and by default checks all floppy media
SYNOPSIS
volcheck [-v] [-i secs] [-t secs] pathname
DESCRIPTION
The volcheck utility tells Volume Management to look at each dev/pathname in sequence and determine if new media has been inserted in the
drive.
The default action is to volcheck all checkable media managed by volume management.
OPTIONS
The following options are supported:
-i secs Set the frequency of device checking to secs seconds. The default is 2 seconds. The minimum frequency is 1 second.
-t secs Check the named device(s) for the next secs seconds. The maximum number of seconds allowed is 28800, which is 8 hours. The fre-
quency of checking is specified by -i. There is no default total time.
-v Verbose.
OPERANDS
The following operands are supported:
pathname The path name of a media device.
EXAMPLES
Example 1: A sample of the volcheck command.
The following example
example% volcheck -v /dev/diskette
/dev/diskette has media
asks Volume Management to examine the floppy drive for new media.
The following example
example% volcheck -i 2 -t 600 /dev/diskette1 &
asks Volume Management if there is a floppy in the floppy drive every 2 seconds for 600 seconds (10 minutes).
FILES
/dev/volctl Volume Management control port
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWvolu |
+-----------------------------+-----------------------------+
SEE ALSO
eject(1), volcancel(1), volmissing(1) rmmount(1M), vold(1M), rmmount.conf(4), vold.conf(4), attributes(5), volfs(7FS)
WARNINGS
Due to a hardware limitation in many floppy drives, the act of checking for media causes mechanical action in the floppy drive. Continu-
ous polling of the floppy drive will cause the drive to wear out. It is recommended that polling the drive only be performed during periods
of high use.
SunOS 5.10 21 Feb 1997 volcheck(1)