08-07-2009
Copy the latest file from one directory to another
Hi All,
I am in the directory a/b/processed
the files in this directories are
-rw-r--r-- 1 owb users 330 Aug 8 chandantest.txt_08082008
-rw-r--r-- 1 owb users 220 Aug 7 chandantest.txt_07082008
-rw-r--r-- 1 owb users 330 Aug 6 chandantest.txt_06082008
-rw-r--r-- 1 owb users 220 Aug 5 chandantest.txt_05082008
I would like to copy the latest file i.e chandantest.txt_08082008 into a/b/data.
Will you please help me in this
Thanks in advance!!!!
Chandan
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I have a problem.
I have some text files in a folder. The names can be like:
emp_20080307053015.dat
emp_20080306053015.dat
emp_20080305053015.dat
emp_20080304053015.dat
The date format appended is like yyyymmdd and timestamp.
What i need is i have to copy the latest file every... (3 Replies)
Discussion started by: Aswarth
3 Replies
2. Shell Programming and Scripting
Hi Team,
I wish to copy the latest file of pattern "MyFile*" to some other location.
I need to do all the operation in a single command separated by |.
ls -rt <MyFile*> | tail -1 | <copy command>.
How can I do?
Please help me.
Thanks,
Kanda (2 Replies)
Discussion started by: spkandy
2 Replies
3. Shell Programming and Scripting
Hi Expert Team,
I performed the below piece of code to copy the latest file in the remote server's directory to the same server's other directory.
But it is not working properly.
How can i handle this? Can you please help me..?
ssh ${REMOTE_USERID}@${REMOTE_HOSTNAME} "cp -p `ssh... (3 Replies)
Discussion started by: spkandy
3 Replies
4. Shell Programming and Scripting
I Need help for one requirement,
I want to move the latest/Older file in the folder to another file. File have the datetimestamp in postfix.
Example:
Source Directory : \a
destination Directory : \a\b
File1 : xy_MMDDYYYYHHMM.txt (xy_032120101456.txt)
File2: xy_MMDDYYYYHHMM.txt... (1 Reply)
Discussion started by: pp_ayyanar
1 Replies
5. Shell Programming and Scripting
Hi All,
In my unix server, I have the following files:
h1.txt
h2.txt
h3.txt
and through SFTP i need to copy only the latest file to another unix server.
Can you please let me know what command i need to use.
Thanks in Advance, (2 Replies)
Discussion started by: HemaV
2 Replies
6. Shell Programming and Scripting
Hi,
There is csv file generated at /usr/data on server1 on monthly basis.
It is in the format reportYYYYDD(e.g 201105).
I needed a script which would copy the latest generated file from the location to another server at /usr/loc
Please can you help? (2 Replies)
Discussion started by: Alok Ranjan
2 Replies
7. Shell Programming and Scripting
I wan to pick the latest modified file name and redirect it to a file ..
ls -tr | tail -1 >file
but this is printing file ins side the filename ,
can anyone help me out (5 Replies)
Discussion started by: vishwakar
5 Replies
8. UNIX for Dummies Questions & Answers
#!/bin/bash
for i in {1..1536..1}
do
#find /home/test/Desktop/up111/workplace/Malware/$i/logs
for a in /home/test/Desktop/up111/workplace/Malware/$i/logs/*
do
#max=a
for b in /home/test/Desktop/up111/workplace/Malware/$i/logs/*
do
... (4 Replies)
Discussion started by: upvan111
4 Replies
9. UNIX and Linux Applications
Hi All,
One job in unix server will generate .csv files daily. I need to copy the latest of these .csv file from the unix server to the shared drive/folder in windows through unix script. My shared folder will look something like
W:\some folder(for example). Could any one of you please help... (3 Replies)
Discussion started by: jaya@123
3 Replies
10. UNIX for Dummies Questions & Answers
I am trying to fetch the latest modified file from a directory using the command
find . -type f -exec ls -lt \{\} \+ | head | awk '{print $9}'
After the O/P, I get the below mentioned error and the command doesnt terminate at all.
find: ls terminated by signal 13
find: ls terminated by... (2 Replies)
Discussion started by: Sree10
2 Replies
LEARN ABOUT DEBIAN
builddbm
BUILDDBM(8) Yard Radius Manual BUILDDBM(8)
NAME
builddbm - users.db compiler
SYNOPSIS
builddbm [ -hvx ] [ -d directory ] [ -l file ]
DESCRIPTION
YARD RADIUS builddbm is a program that builds the GDBM format of the `users' file, which could be used in conjunction with the radiusd `-b'
flag. The users file should resides in the standard configuration directory, as selected at configuration time. It should be run as root.
Be also sure to set mode 600 for the `users' file as well as the resulting `users.db'.
OPTIONS
-d directory
Changes the source `users' file directory. The default value is /usr/conf. The destination directory of `users.db' is the same one.
-h Prints out usage of the command.
-v Prints version information.
-l file
Changes the logging file.
-x Prints (or should do so) debugging messages while compiling.
FILES
/usr/conf/users
This file contains the human readable information for users' accounting and authorization. See radius_attributes(5) for details
about its syntax.
/usr/conf/users.db
The same of the previous one as compiled in by builddbm in GDBM format. It needs to be compiled again every time you make changes to
the previous one and without restarting radiusd .
/usr/conf/dictionary
This read-only file contains the codes and formats for standard and vendor RADIUS protocol attributes and values along with their
human readable representation. It is subject to change, due to new access server supports. It is a plain text file with a pletora of
comments in it.
SEE ALSO
radiusd(8), radlast(1), radlist(1), radtest(1), radwatch(1), radius_attributes(1), gdbm(3)
COPYRIGHT
Copyright (C) 1992-1999 Lucent Inc. All rights reserved.
Copyright (C) 1999-2004 Francesco Paolo Lovergine. All rights reserved.
See the LICENSE file enclosed within this software for conditions of use and distribution. This is a pure ISO BSD Open Source License .
NOTES
The syntax of the source users file is not described here. Please, refer to the official Livingston documentation, which includes the
RADIUS for UNIX Administrator's Guide.
1.1 Aug 25, 2004 BUILDDBM(8)