Sponsored Content
Top Forums Shell Programming and Scripting Conditional File Movement script scheduled using CRON job Post 83665 by imu on Saturday 17th of September 2005 08:36:39 AM
Old 09-17-2005
Conditional File Movement script scheduled using CRON job

Hi All,
i am trying to automate a process and have to create a unix script like wise. I have a scenario in which i need to automate a file movement. Below are the steps i need to automate.

1. Check whether a file (Not Fixed name-Pattern search of file say 'E*.dat') is present in a directory /hm/srcfiles. In this directory, there will be files placed by a JSP on adhoc basis like E1.dat,E2.dat,E3.dat ......
2. A script/Job keeps sniffing this directory for files of this kind.... the moment it finds one, it should transfer the file to other directory say /hm/tgt but with renaming it to 'FILE.dat'. This transfer is conditional, the file movement should happen only if the /hm/tgt directory does not contain 'FILE.dat', and if 'FILE.dat' is present, it should wait and try to move the file again untill succeded.
3.The cleanup of file 'FILE.dat' from /hm/tgt/FILE.dat happens by another shell script called by a different application. I am kind of able to write that (I have not worked with unix scripting much Smilie )
4.I guess CRON job scheduling should be used for triggering the file movement script, correct me if i am wrong.
5.This CRON job should run contineously and trigger the script when ever the
file named like 'E*.dat' arrives. Also if many files are present in /hm/src directory, all the files should be processed sequentially Smilie

Thanks for the patience to read the explaination. I do not know scripting much OR have used CRON job scheduling before. Can someone help me in this regard. I a sound too naive with UNIX, it is because i am Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

AT job scheduled exactly 2 hours late

This occurs on an i386 box running Unix System V/386 Release 4.2 Ver 1.1.2. I have an 'at' scheduling anomaly whose behavior I am trying to understand. On one particular system, when an 'at' job is submitted, the time the job is actually scheduled to run is exactly 2 hours later than what the... (10 Replies)
Discussion started by: bohunk24
10 Replies

2. UNIX for Dummies Questions & Answers

problem when the script is scheduled to run as cron job

Hello, I have problem in executing a shell script. When the shell script is executed at the shell prompt the script works successfully but when the same script is run as a cron job it fails to execute the files called within the shell script. I have scheduled the job in my crontab file as ... (6 Replies)
Discussion started by: forumthreads
6 Replies

3. UNIX for Dummies Questions & Answers

Scheduled job

I have a lot of jobs scheduled using at command. at -l gives only the job names and time ... how do i know which script is associated with which jobid. Thanks. (1 Reply)
Discussion started by: blackeyed
1 Replies

4. Shell Programming and Scripting

Running script file using cron job every 5 second

Hi All, I beginner in unix, i have no idea how to set the script file using cron job every 5 second. I also want to execute automatically the output to text file.This is my script name countsys.sh and my textfile abc.txt. (6 Replies)
Discussion started by: mastercar
6 Replies

5. Programming

Oracle Scheduled job not running as per schedule.

Hi, Though this is a unix forum mainly, am posting this oracle query here hoping to get a resolution. I have set up two scheduled jobs in oracle 11g for executiong a procedure in specific time intervals. One as Hourly and other as minutely. But the scheduled jobs are not running as per... (2 Replies)
Discussion started by: suresh_kb211
2 Replies

6. Shell Programming and Scripting

sftp script file movement

Hi, I am newbie in unix scripting, I have written a bash script of SFTP that transfer some files from one folder to another within a server , I have two folders test and temp in the directory /home/p5060/sxk124 , the temp folder(/home/p5060/sxk124/temp)contain the files which I through my... (5 Replies)
Discussion started by: KAREENA18
5 Replies

7. Shell Programming and Scripting

run unix script as scheduled job

Hi, I want my unix script to run as a scheduled job such that the script is invoked once every 15 minutes. Is there any way to achieve this other than running the script as a cron job? (2 Replies)
Discussion started by: vignesh53
2 Replies

8. Shell Programming and Scripting

[SOLVED] help clean up file movement script

Hello Group, Once again another script hacked together from a few sources to try and suit my needs. This is to go through a /temp directory and for each ls entry ask which Dir of three I want it sorted. The script works but there are a few behaviors that are odd so I figured I'd ask for help... (2 Replies)
Discussion started by: dpreviti
2 Replies

9. Shell Programming and Scripting

Scheduled job not running automatically in crontab

i have a job scheduled in crontab. The problem is, it is not running automatically as per the time scheduled. But runs when executed manually. What would be the problem? Help me with this please. (6 Replies)
Discussion started by: Santhosh CJ
6 Replies

10. UNIX for Beginners Questions & Answers

Cron job scheduled is running once, but reports are generating twice

Team, Hope you all are doing fine I have one admin server which is being used dedicately to run cron jobs on hourly basis, fetching the details from Database which is in a different server.These cronjob are run on every hourly/5 minutes basis depending as per end user requirement.The script... (12 Replies)
Discussion started by: whizkidash
12 Replies
load_datafile(3alleg4)						  Allegro manual					    load_datafile(3alleg4)

NAME
load_datafile - Loads a datafile into memory. Allegro game programming library. SYNOPSIS
#include <allegro.h> DATAFILE *load_datafile(const char *filename); DESCRIPTION
Loads a datafile into memory in one go. If the datafile has been encrypted, you must first call packfile_password() to set the appropriate key. If the datafile contains truecolor graphics, you must set the video mode or call set_color_conversion() before loading it. Example: /* Load the resources for our game. */ DATAFILE *dat = load_datafile("game.dat"); if (!dat) abort_on_error("Couldn't load sound resources!"); /* Use resources. */ ... /* Destroy them when we don't need them any more. */ unload_datafile(dat); RETURN VALUE
Returns a pointer to the DATAFILE, or NULL on error. Remember to free this DATAFILE later to avoid memory leaks. SEE ALSO
load_datafile_callback(3alleg4), unload_datafile(3alleg4), load_datafile_object(3alleg4), set_color_conversion(3alleg4), fixup_datafile(3alleg4), packfile_password(3alleg4), find_datafile_object(3alleg4), register_datafile_object(3alleg4), excustom(3alleg4), exdata(3alleg4), exexedat(3alleg4), exgui(3alleg4), exsprite(3alleg4), exunicod(3alleg4) Allegro version 4.4.2 load_datafile(3alleg4)
All times are GMT -4. The time now is 12:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy