Sponsored Content
Top Forums Shell Programming and Scripting Move file in to directory- script Post 302925148 by primo102 on Friday 14th of November 2014 08:28:27 AM
Old 11-14-2014
Move file in to directory- script

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:
Code:
file created on 2014-10-10 move to directory /mnt/upload/20141010
file created on 2014-11-11 move to directory /mnt/upload/20141111
file created on 2014-08-01 move to directory /mnt/upload/20140801

So the script first creates a directory with the correct name ( format +%Y%m%d) move all files in a day (but only files not directory) in to right directory.

any ideas ?

Last edited by jim mcnamara; 11-14-2014 at 04:52 PM..
 

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

Unix script to MOVE via FTP a directory

Good afternoon! I need to move a bunch of files from an FTP site to my server. However mget *, dele * will not suffice as I cannot guarantee that new files are not uploaded between commands. Roughly, this is what I would like to do: (using a .netrc) ftp somehost bin prompt cd... (1 Reply)
Discussion started by: abirdd
1 Replies

3. Shell Programming and Scripting

A script that will move a file to a directory with the same name and then rename that file

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

4. Shell Programming and Scripting

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... (1 Reply)
Discussion started by: pp_ayyanar
1 Replies

5. Shell Programming and Scripting

Script to move files to a directory according to date

hi all, here is the description to my problem. input parameter: $date1 based on the date i need to select three files starting with audit.log* based on its modified date, a date before, a date after(if its exists). We need to compare the input date to modified date of the file. And then... (3 Replies)
Discussion started by: ashrocks
3 Replies

6. Programming

Script for creating a directory & move the .tif files in it.

Hi Team, I have thousands of TIF files which are converted from PDF. Below is a sample of it. LH9406_BLANCARAMOS_2012041812103210320001.tif LH9406_BLANCARAMOS_2012041812103210320002.tif LH9406_BLANCARAMOS_2012041812103210320003.tif LH9411_ANGENIAHUTCHINSON_2012041812102510250001.tif... (9 Replies)
Discussion started by: paragnehete
9 Replies

7. UNIX for Dummies Questions & Answers

move a file content to another directory

my script is: /u/user/orginal/:#! /bin/ksh find . -name "aur_prog*" -exec grep -il "error" > test.out #awk command to destination directory exit test.out file contain: ./aur_prog1.log ./aur_prog2.log ... (5 Replies)
Discussion started by: roughwal
5 Replies

8. 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

9. UNIX for Dummies Questions & Answers

How to move file from one directory to other of only particular user?

I written unix script where a pdf file generates. But if the script is used by multiple people at a time it generates same pdf with two different owner names and creating a problem with permission while moving the file. is there a way where i can move the file filtering with the user? (4 Replies)
Discussion started by: lakers646
4 Replies

10. 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
ABRT.CONF(5)							    ABRT Manual 						      ABRT.CONF(5)

NAME
abrt.conf - Configuration file for abrt. DESCRIPTION
abrt is a daemon that watches for application crashes. When a crash occurs, it collects the problem data and takes action according to its configuration. This document describes abrt's configuration file. The configuration file consists of items in the format "Option = Value". A description of each item follows: DumpLocation = directory The directory where should abrt store coredumps and all files which are needed for reporting. The default is /var/tmp/abrt. MaxCrashReportsSize = number The maximum disk space (specified in megabytes) that abrt will use for all the crash dumps. Specify a value here to ensure that the crash dumps will not fill all available storage space. The default is 1000. WatchCrashdumpArchiveDir = directory The daemon will watch this directory and call abrt-handle-upload on files which appear there. This is used to auto-unpack crashdump tarballs uploaded via ftp, scp, etc. The directory must exist and be writable for abrt. There is no default. DeleteUploaded = yes/no The daemon will delete an uploaded crashdump archive after an atempt to unpack it. An archive will be delete whether unpacking finishes successfully or not. The default value is no. SEE ALSO
abrtd(8) abrt-action-save-package-data.conf(5) abrt-handle-upload(1) AUTHORS
o ABRT team abrt 2.1.11 06/18/2014 ABRT.CONF(5)
All times are GMT -4. The time now is 02:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy