Sponsored Content
Top Forums Shell Programming and Scripting Move the latest or older File from one directory to another Directory Post 302407117 by pp_ayyanar on Wednesday 24th of March 2010 02:42:30 PM
Old 03-24-2010
Move the latest or older File from one directory to another Directory

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 (xy_032120101856.txt)

i want to move latest/older file which is File2 need to destination folder. need to achive this in shell script.

Any idea? Please. Thanks in advance.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Move all files in a directory tree to a signal directory?

Is this possible? Let me know If I need specify further on what I am trying to do- I just want to spare you the boring details of my personal file management. Thanks in advance- Brian- (2 Replies)
Discussion started by: briandanielz
2 Replies

2. Shell Programming and Scripting

Move a file from windows directory to unix directory

Move a file from windows directory to unix directory, is this possible? if it is, can someone help me on this? Thanks! God bless! (1 Reply)
Discussion started by: kingpeejay
1 Replies

3. Shell Programming and Scripting

Copy the latest file to a directory

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

4. Shell Programming and Scripting

Script to move latest zip file to another directory

Hi folks, In my application there is a job running which create a .dat file along with it zip file also at unix box location /opt/app/cvf/temp1 so in temp1 directory I have one .dat file and its zip file also. Now since this job runs every day so if a job runs today there will be two files... (5 Replies)
Discussion started by: punpun66
5 Replies

5. Shell Programming and Scripting

How to move the files older than x days with similar directory structure?

Hello, I need to move all the files inside /XYZ (has multi-depth sub directories) that are older than 14 days to/ABC directory but with retaining the SAME directory structure. for example: /XYZ/1/2/3/A/b.txt should be moved as /ABC/1/2/3/A/b.txt I know about find /XYZ -type f -mtime +14... (3 Replies)
Discussion started by: prvnrk
3 Replies

6. Shell Programming and Scripting

List files with date, create directory, move to the created directory

Hi all, i have a folder, with tons of files containing as following, on /my/folder/jobs/ some_name_2016-01-17-22-38-58_some name_0_0.zip.done some_name_2016-01-17-22-40-30_some name_0_0.zip.done some_name_2016-01-17-22-48-50_some name_0_0.zip.done and these can be lots of similar files,... (6 Replies)
Discussion started by: charli1
6 Replies

7. UNIX for Dummies Questions & Answers

How to move gz files from one source directory to destination directory?

Hi All, Daily i am doing the house keeping in one of my server and manually moving the files which were older than 90 days and moving to destination folder. using the find command . Could you please assist me how to put the automation using the shell script . ... (11 Replies)
Discussion started by: venkat918
11 Replies

8. Shell Programming and Scripting

Shell script cannot create directory and move the file to that directory

I have a script, which is checking if file exists and move it to another directory if then mkdir -p ${LOCL_FILES_DIR}/cool_${Today}/monthly mv report_manual_alloc_rpt_A_I_ASSIGNMENT.${Today}*.csv ${LOCL_FILES_DIR}/cool_${Today}/monthly ... (9 Replies)
Discussion started by: digioleg54
9 Replies

9. Shell Programming and Scripting

Send email if latest file in a directory is older than 2 hours

I have a objective of Sending email if latest file in a directory(excluding files of sub-dirs) is older than 2 hours. eg : ls -ltr drwx--x--x 2 abcde abc 256 2017-02-07 20:10 Mail -rw-rw-r-- 1 abcde abc 1170 2017-02-24 17:30 test -rw-rw-r-- 1 abcde abc 356 2017-03-09 18:00 xyz.csv... (3 Replies)
Discussion started by: simpltyansh
3 Replies
Plack::App::File(3pm)					User Contributed Perl Documentation				     Plack::App::File(3pm)

NAME
Plack::App::File - Serve static files from root directory SYNOPSIS
use Plack::App::File; my $app = Plack::App::File->new(root => "/path/to/htdocs")->to_app; # Or map the path to a specific file use Plack::Builder; builder { mount "/favicon.ico" => Plack::App::File->new(file => '/path/to/favicon.ico'); }; DESCRIPTION
This is a static file server PSGI application, and internally used by Plack::Middleware::Static. This application serves file from document root if the path matches with the local file. Use Plack::App::Directory if you want to list files in the directory as well. CONFIGURATION
root Document root directory. Defaults to "." (current directory) file The file path to create responses from. Optional. If it's set the application would ALWAYS create a response out of the file and there will be no security check etc. (hence fast). If it's not set, the application uses "root" to find the matching file. encoding Set the file encoding for text files. Defaults to "utf-8". content_type Set the file content type. If not set Plack::MIME will try to detect it based on the file extension or fall back to "text/plain". AUTHOR
Tatsuhiko Miyagawa SEE ALSO
Plack::Middleware::Static Plack::App::Directory perl v5.14.2 2014-10-09 Plack::App::File(3pm)
All times are GMT -4. The time now is 01:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy