invoke this command after every 10 mins


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting invoke this command after every 10 mins
# 1  
Old 10-04-2011
invoke this command after every 10 mins

Hi,
I have an command which find the files modified within last 3 days and then after selecting the files from the location it make the tar format and send it to the specified destination ...now I want that this task to be automative ..that is it should happen after every 5 minutes ..plz guide me how to to proceed and also the command ..I am sending u the below command which i want to be get automative...
Code:
find /home/499633/files -iname "*.txt" -mtime -3| xargs tar -cvzf /home/499633/output/backup.tar

Smilie

Last edited by Franklin52; 10-04-2011 at 03:46 AM.. Reason: Please use code tags, thank you
# 2  
Old 10-04-2011
if the above posted command is working fine ... then put that in while loop and set the sleeper ..
Code:
while [ 1 ]
do
     find /home/499633/files -iname "*.txt" -mtime -3| xargs tar -cvzf /home/499633/output/backup.tar
     sleep 300 ## for 5 mins
done

# 3  
Old 10-04-2011
Hi jayan,

Thanx a lot , it is working fine..and I also want to know if I want to run this command let say on every friday of the week @ 3pm, then plz guide me how to proceed for this , if possible can u also send the script as earlier post ..!!

Smilie
# 4  
Old 10-04-2011
then go for cron entry .. put the command in a file
Code:
$ cat infile
find /home/499633/files -iname "*.txt" -mtime -3| xargs tar -cvzf /home/499633/output/backup.tar

Add it in cron ..
Code:
00 15 * * 5 sh /your/script/path/infile 2>&1

# 5  
Old 10-04-2011
Hi jayan,

Thanx a lot , its working ..!! thanks..!!

---------- Post updated at 03:47 AM ---------- Previous update was at 01:52 AM ----------

Quote:
Originally Posted by jayan_jay
if the above posted command is working fine ... then put that in while loop and set the sleeper ..
Code:
while [ 1 ]
do
     find /home/499633/files -iname "*.txt" -mtime -3| xargs tar -cvzf /home/499633/output/backup.tar
     sleep 300 ## for 5 mins
done


Hi jayan,
I have tried u r this script , but the files r immediately getting transferred ...I mean to say that they should be get transfferd after 5 minutes ...!!Smilie
# 6  
Old 10-04-2011
Closed!
User banned for flagrant disregard of rules... As all attempts to ask you to use code tags remained unsuccessful, your original account was set temporarily as Read Only... You are NOT to recreate a new account to bypass your Status AND continue to ignore the rules as if nothing happened!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need logs 5 mins old

I need 5 mins old logs to be dumped into a a new file. The date formats in the two log files are Can you suggect for both formats ? bash-3.2$ uname -a SunOS myserver 5.10 Generic_150400-26 sun4v sparc sun4v ---------- Post updated 05-04-16 at 12:24 AM ---------- Previous update was... (2 Replies)
Discussion started by: mohtashims
2 Replies

2. Shell Programming and Scripting

Retrieve logs generated in last 10 mins from a log file using 'grep' command

HI All, I have a log file where the logs will be in the format as given below: 2011-05-25 02:32:51 INFO PROCESS STARTING 2011-05-25 02:32:52 INFO PROCESS STARTED . . . I want to retrieve only the logs which are less than 5 mins older than current time using grep... (3 Replies)
Discussion started by: rvhg16
3 Replies

3. Shell Programming and Scripting

mail command | takes 10 mins.

I'm trying to send a e-mail through a shell script using the mail command. TO=your_mail@gmail.c,my_mail@gmail.com mail -s "This is a mail" $TO < Message.txt I receive mail only after 15-20mins but if i specify on 1 email id, I get the mail in seconds. Why is this happening? (0 Replies)
Discussion started by: rocker_me2002
0 Replies

4. Shell Programming and Scripting

invoke fork command

Hi, I have startup shell script called "xxxxx" for Jboss server which is taking more than expected timeline to complete the process, here I want to use the fork command to start the child process for non dependent component I have a scheduler called "yyyy" which is currently getting invoked... (2 Replies)
Discussion started by: harish76
2 Replies

5. Shell Programming and Scripting

How to run the particular command continously for 30 mins in perl?

Hi, I have command that should run continuously for 30 mins but not every day not once in a week , not one in a month. whenever i call that particular program that command should run for 30 mins and stop. #Contents of test.pl `ls -l *.txt`; #some other lines of code to print ... (1 Reply)
Discussion started by: vanitham
1 Replies

6. Shell Programming and Scripting

invoke unix variable in SED command

Hi, I am trying tio invoke unix variable in a sed command like below, but it seems to be failing.. a=1 sed -n '$a,$p' file.txt ### Failing but a=1 sed -n '1,$p' files.txt ### Works fine Please help me to fix this... Thanks in advance (2 Replies)
Discussion started by: vjayraghavan
2 Replies

7. Solaris

How to securely invoke a Solaris privildged command (root) remotely?

Hi, What I would like to do "securely" is the following. From one central server invoke a script that does the following. --Store user/name passwords. (password possibly encrypted in config file) --From the central server invoke a privileged command (i.e. route add) on multiple... (1 Reply)
Discussion started by: topstuff
1 Replies

8. Shell Programming and Scripting

How can i invoke SU command in shell script

Hi All , i am trying to switch user (from unix1 to unix 2 ) The user will give me the input and also the password . also how can i login into with the password . itried several attempts . no luck Can any one help on this !!! (4 Replies)
Discussion started by: raghav1982
4 Replies

9. Shell Programming and Scripting

run a command automatically after every 10 mins

Hi friends, I need to write a script which runs a command (on that particular server only) after every 10 mins, and the contents are also echoed on that very terminal only. And then I need to compare the last two outputs, and mail if there is any difference in the last two outputs. Can we set... (4 Replies)
Discussion started by: vikas027
4 Replies

10. UNIX for Dummies Questions & Answers

command to run a command after 30 mins

how to schedule a command to run after 30 mins ? (3 Replies)
Discussion started by: gridview
3 Replies
Login or Register to Ask a Question