09-01-2013
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 one is .dat file and other is it's .zip file and let say next day job also runs so what it does is that it keep the previous day .zip file but it delete the .dat file of previous day instead and it creates the new .dat file of present day, so total will be there 3 files for that day , one previous day .zip file and one present day .zip file and one present day.dat file. and so on cycle contionus , so finally I have one .dat file only and remaning previos zip files at temp1 directory
Now my objective is to move the .zip file of the latest one to the other location at /opt/app/cvf/temp2 , please advise the script that will move the latest .zip file to the temp2 directory.
I am using bash shell in unix.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have these zip files that come in with the same name, but different versions. We'll say:
SQL_version2.zip
SQL_version3.zip
SQL_version2432.zip
I was wondering if there is a single command (or even piped command, thus still making it a single command) that will let me unzip the latest... (3 Replies)
Discussion started by: mrwatkin
3 Replies
2. Shell Programming and Scripting
Hello all.
I am new to this forum (and somewhat new to UNIX / LINUX - I started using ubuntu 1 year ago).:b:
I have the following problem that I have not been able to figure out how to take care of and I was wondering if anyone could help me out.:confused:
I have all of my music stored in... (7 Replies)
Discussion started by: marcozd
7 Replies
3. 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
4. Shell Programming and Scripting
Hello,
I need a simple script to Auto-detect new files and folders in the directory.
And then I need to zip the new files and bzip2 new folders and move them out of that folder where I am detecting changes to the other folder.
Remember, I need simple one. If anyone could do it fast, I may... (1 Reply)
Discussion started by: juzt1s
1 Replies
5. UNIX for Dummies Questions & Answers
Hi,
need to zip all files in a directory and move to another directory after the zip..
i am using this one but didnt help me...
zip -r my_proj_`date +%Y%m%d%H%MS`.zip /path/my_proj
mv in_proj_`date +%Y%m%d%H%M%S`.zip /path/source/
i am trying to zip all the files in my_proj... (0 Replies)
Discussion started by: dssyadav
0 Replies
6. Shell Programming and Scripting
Hi all,
I am receiving files named like:
ABC_20120730.csv
ABC_20120801.csv
ABC_20120812.csv
They are residing in a folder named Incoming.
I am supposed to write a script that will create a filelist which will contain only the name of the latest file beginning with ABC_, by YYYYMMDD... (3 Replies)
Discussion started by: kedrick
3 Replies
7. Shell Programming and Scripting
Hi,
Anybody help me to write a Shell Script
Get the latest file from the file list based on created and then move to the target directory.
Tried with the following script: got error.
A=$(ls -1dt $(find "cveit/local_ftp/reflash-parts" -type f -daystart -mtime -$dateoffset) | head... (2 Replies)
Discussion started by: saravan_an
2 Replies
8. Shell Programming and Scripting
I want to write a korn shell script to get the latest three versions for a file in the directory having lot of files with various versions (files with prefix as same but time stamp as suffix) and compress it and at the same time have to remove the remaining versions of the file (other than latest... (4 Replies)
Discussion started by: maheshbabu
4 Replies
9. Shell Programming and Scripting
Hi
In directory /mnt/upload I have about 100 000 files (*.png) that have been created during the last six months. Now I need to move them to right folders. eg:
file created on 2014-10-10 move to directory /mnt/upload/20141010
file created on 2014-11-11 move to directory /mnt/upload/20141111... (6 Replies)
Discussion started by: primo102
6 Replies
10. Shell Programming and Scripting
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
LEARN ABOUT DEBIAN
dwww-refresh-cache
DWWW-REFRESH-CACHE(8) Debian DWWW-REFRESH-CACHE(8)
NAME
dwww-refresh-cache - rebuilds dwww cache directory
SYNOPSIS
dwww-refresh-cache
DESCRIPTION
dwww-refresh-cache is a simple shell script, which deletes outdated cache files and rebuilds contents of the dwww cache directory
/var/cache/dwww. In default installation, the script is called from /etc/cron.daily/dwww, so the cache is refreshed every day.
CONFIGURATION VARIABLES
DWWW_KEEPDAYS
Specifies, how many days documents that have not been accessed should be kept in the cache. Default is 10 days.
DWWW_QUICKFIND_DB
Location of the installed packages and programs cache file, generated with help of dwww-quickfind(8). Default is
/var/cache/dwww/quickfind.dat.
DWWW_DOCBASE2PKG_DB
Location of the cache file, which maps installed doc-base files to packages names, used by the dwww-build-menu(8). Default is
/var/cache/dwww/docbase2pkg.dat.
FILES
/etc/dwww/dwww.conf
Configuration file for dwww(7).
/var/cache/dwww
dwww cache directory.
/etc/cron.daily/dwww.
dwww daily cron job
SEE ALSO
dwww(7), dwww-build-menu(8), dwww-cache(8), dwww-find(8).
AUTHOR
Robert Luberda.
See dwww(7), for copyrights and stuff.
dwww 1.11.1 February 15th, 2009 DWWW-REFRESH-CACHE(8)