If you have control over how files are put onto the remote server then implementing a rename policy is the best way:
If not you will have to monitor the directory to see if the new files are changing. I would suggest getting lftp as it is a scriptable client that can be used with different protocols and has a mirror command.
You would keep a local list of files in that directory and download a new list periodically, comparing the two lists. When there are new files your script then checks more frequently until the size of the new files stops changing. Then the copying could be done.
I could give you a copy of an lftpls script I've written to give you a start
Dear expert,
Suppose I have an application that comes in rpm format.
Let's call it:
my_downloaded_package.rpm
How can I install it in my particular home directory (since I'm not
a root user). Say the directory where I want to install above rpm package is:
~/.my_desired_location... (1 Reply)
What is the best way for a script to run to monitor a directory for the presence of files and then perform a function afterwords? I was hoping to have it continually run and sleep until it detects that files are present in the directory, then break out of the loop and go on to the next step.
... (17 Replies)
Hi All,
We are having important config files in an directory which was accessable by all
/auto/config/Testbed/>ls
config1.intial
config2.intial
config3.inital
often we find that some of the lines are missing in config files, we doubt if some one is removing.
I would like to write... (0 Replies)
Good morning.
I have been attempting to find a way to monitor the capacity of a directory so that when it reaches 80% or higher I can send an event.
I was able to find a script that does this for the whole drive by I can not seem to figure out how to do this for just a single directory.
... (1 Reply)
I'm am looking for a cheap way to trigger a script when a new file is written in a specific directory. AIX 5.3. It is a production system, so no kernel patching (i.e. inotify).
Filemon and audtiing are too expensive.
Thanks in advance. (2 Replies)
Hi,
I've created solaris user which has both FTP and SFTP Access. Using the "ftpaccess" configuration file options "guest-root" and "restricted-uid", i can restrict the user to a specific directory. But I'm unable to restrict the user when the user is logged in using SFTP.
The aim is to... (1 Reply)
Hi,
I need to write a directory monitor, i.e. a korn shell script which would
Report changes to the directory contents, like:
added file1,
deleted file2,
updated file3 ,
created subdir (optional)...
There is no specific file pattern.
So far I have written a little script... (1 Reply)
Greetings,
I made an extraction on 2 different databases. What I need to do is to compare those extractions to know what is on database1 which is not on database2 and vice versa.
In those files, there are only numbers. So each line is just a number witch should be present on both file. If... (6 Replies)
Hello,
I have a weird issue, I have RHEL 5.7 running with openssh5.2 where sftpgroup OS group is chroot. I see the difference difference in timestamp on files, when I login via ssh and SFTP, I see four hour difference, is something missing in my configuration.
#pwd... (8 Replies)
Discussion started by: bobby320
8 Replies
LEARN ABOUT CENTOS
rename
RENAME(1) User Commands RENAME(1)NAME
rename - rename files
SYNOPSIS
rename [options] expression replacement file...
DESCRIPTION
rename will rename the specified files by replacing the first occurrence of expression in their name by replacement.
OPTIONS -v, --verbose
Give visual feedback which files where renamed, if any.
-V, --version
Display version information and exit.
-s, --symlink
Peform rename on symlink target
-h, --help
Display help text and exit.
EXAMPLES
Given the files foo1, ..., foo9, foo10, ..., foo278, the commands
rename foo foo0 foo?
rename foo foo0 foo??
will turn them into foo001, ..., foo009, foo010, ..., foo278. And
rename .htm .html *.htm
will fix the extension of your html files.
WARNING
The renaming has no safeguards. If the user has permission to rewrite file names, the command will perform the action without any ques-
tions. For example, the result can be quite drastic when the command is run as root in the /lib directory. Always make a backup before
running the command, unless you truly know what you are doing.
SEE ALSO mmv(1), mv(1)AVAILABILITY
The rename command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
util-linux June 2011 RENAME(1)