Sponsored Content
Top Forums Shell Programming and Scripting File in a folder and loop until time Post 302424729 by RubinPat on Wednesday 26th of May 2010 07:08:58 AM
Old 05-26-2010
Thanks Bakunin....for your consistent help....I honestly appreciate it....Now about the
current_time=$(date +'%H%M') ...I saw that in your code being mentioned but removed it because I was tellling you my code ..what I had in hand....I will try your code today with the current_time as you said....yes you are right actually about the run_time....it was already there in another code as i said before and I thought to keep it....My requirement is simply :A job will run daily at anytime before 9 AM and would look for a file named filename.txt in a folder and if it finds then move it to a different folder and if not found until 9 A.M it will exit with a success code. Can you suggest me a code please. Lots of thanks in advance.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parse the .txt file for folder name and FTP to the corrsponding folder.

Oracle procedure create files on UNIX folder on a regular basis. I need to FTP files onto windows server and place the files, based on their name, in the corresponding folders. File name is as follows: ccyymmddfoldernamefile.txt; Folder Name length could be of any size; however, the prefix and... (3 Replies)
Discussion started by: MeganP
3 Replies

2. Shell Programming and Scripting

File Management: How do I move all JPGS in a folder structure to a single folder?

This is the file structure: DESKTOP/Root of Photo Folders/Folder1qweqwasdfsd/*jpg DESKTOP/Root of Photo Folders/Folder2asdasdasd/*jpg DESKTOP/Root of Photo Folders/Folder3asdadfhgasdf/*jpg DESKTOP/Root of Photo Folders/Folder4qwetwdfsdfg/*jpg DESKTOP/Root of Photo... (4 Replies)
Discussion started by: guptaxpn
4 Replies

3. UNIX for Dummies Questions & Answers

How to append time to folder

Hi i just want to create a folder with current time. For example. foldername_09042010 How do i modify mkdir or write script to do this? (1 Reply)
Discussion started by: pinga123
1 Replies

4. Shell Programming and Scripting

Last modified time of the folder is changing when I view the file inside the directory

Hi., Last modified time of the folder is changing when I view the file inside the directory. Here is the test on sample directory. I believe that ls -l commands gives the time detail w.r.t last modified time. Pl. suggest. bash-3.2$ mkdir test bash-3.2$ cd test bash-3.2$ touch myfile.txt... (2 Replies)
Discussion started by: IND123
2 Replies

5. Shell Programming and Scripting

Loop through text file > Copy Folder > Edit XML files in bulk?

I have a text file which contains lines in this format - it contains 105 lines in total, but I'm just putting 4 here to keep it short: 58571,east_ppl_ppla_por 58788,east_pcy_hd_por 58704,east_pcy_ga_por 58697,east_pcy_pcybs_por It's called id_key.txt I have a sample folder called... (9 Replies)
Discussion started by: biscuitcreek
9 Replies

6. Shell Programming and Scripting

loop through files in each folder and perform sed

Dear all, I have few log folders in directory (FILE) and i need to perform sed on each files inside each folders. Here is my script, and i wish to rename each file back to the same file name after modification. Can anyone guide me on my script below? eg: folder1 contain files... (2 Replies)
Discussion started by: ymeyaw
2 Replies

7. Shell Programming and Scripting

For loop to read folder which are not under processing

Hi, I want to read folders which do not have a file "processing" in a for loop ordered by timestamp. Currently im doing like this. Like cd /home/working for i in `ls -c1` do some command... done I want to exclude folders which have that "processing" file. The directory... (2 Replies)
Discussion started by: chetan.c
2 Replies

8. Shell Programming and Scripting

For loop for number of files in a folder

Hi All, Need a for loop which should run for number of files in a folder and should pass the file name as parameter to another shell script for each loop. Please help me. Thanks. (2 Replies)
Discussion started by: chillblue
2 Replies

9. UNIX for Dummies Questions & Answers

Loop for file merging in a folder

Dear all, I have a few files in a folder (lets say 5) and each have a few lines in them. I want to create merges of each of them with the other ones e.g. I need the following merges I tried to write a loop and started with combinations of 2, I get the write file names but for each... (17 Replies)
Discussion started by: A-V
17 Replies

10. UNIX for Beginners Questions & Answers

Create new folder and text file the same time in one line

Is it possible to create new folder and write a new text file in the folder while the current position is outside the new folder? in one line mkdir folder | echo "hello test"> folder/test.txt not work. (1 Reply)
Discussion started by: cmdcmd
1 Replies
refile(1)						      General Commands Manual							 refile(1)

NAME
refile - file message in other folders (only available within the message handling system, mh) SYNOPSIS
refile [msgs] [+folder] [options] OPTIONS
Refiles the draft message, or the current message in your +drafts folder, if you have one set up. You cannot give a msgs argument when you use this option. Moves a file into a folder. This option takes a file from its directory and places it in the named folder, as the next message in the folder. The file must be formatted as a legal mail message. This means that the message must have the minimum header fields separated from the body of the message by a blank line or a line of dashes. Prints a list of the valid options to this command. Keeps a copy of the message in the source folder. Normally, refile removes the messages from the original folder when it refiles them. The -link option keeps a copy in the original folder, as well as filing a copy in the new folder. Preserves the number of a message in the new folder. Normally, when a message is refiled in to another folder, it is set to the next available number in that folder. The -preserve option keeps the number of the message the same in the new folder as it had been in the old. You cannot have two messages with the same number in one folder, so you should use this option with care. Specifies the source folder to take messages from. Normally, messages are refiled from the current folder into another folder. However, you can take mes- sages from a different folder by using the -src +folder option to specify the alternative source folder. DESCRIPTION
Use the refile command to move the specified message from the current folder to another folder. You can refile messages in more than one folder by giving multiple folder names as arguments. If you do not specify a message, the current message is refiled. You can refile a message other than the current message by giving its num- ber as a msgs argument. You can also refile more than one message at a time by specifying more than one message number, or a range of mes- sage numbers, or a message sequence. See mark(1) for more information on sequences. The current folder remains the same unless the -src option is specified; in that case, the source folder becomes current. Normally, the last message specified becomes the current message. However, if the -link option is used, the current message is not changed. If the Previous-Sequence: entry is set in the file, in addition to defining the named sequences from the source folder, refile will also define those sequences for the destination folders. See mh_profile(4) for information concerning the previous sequence. PROFILE COMPONENTS
Path: To determine your Mail directory Folder-Protect: To set protections when creating a new folder rmmproc: Program to delete the message EXAMPLES
The following example refiles messages 3 and 5 in the folder +records: % refile 3 5 +records The next example files the current message into two folders: % refile +jones +map The next example takes message 13 in the current folder and refiles it in the +test folder. The mes- sage remains in the current folder as well as appearing in the +test folder. % refile -link 13 +test The next example takes a message from the folder +test when it is not the current folder, and places it in the folder +outbox: % refile 3 -src +test +outbox FILES
The user profile. SEE ALSO
folder(1), mark(1), mh_profile(4) refile(1)
All times are GMT -4. The time now is 07:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy