is this daemon effiecient???


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting is this daemon effiecient???
# 1  
Old 07-09-2002
Question is this daemon effiecient???

I just wanted a script to touch my files once a day so they don't get removed once a day from cleaning, however I was wondering if it was the most effiecient method?

comments are appreciated!

command-prompt>nohup toucher.sh &

Toucher.sh

#!/usr/local/bin/bash

while ((1))
do
touch *
sleep 86400
done
Shakey21
# 2  
Old 07-10-2002
Looks good, though try considering the following:
1.) Change the touch * to touch /path/*
2.) Remove the sleep 86400
3.) Place the script in a cron job
# 3  
Old 07-10-2002
If you're wanting to do this for all files either on the filesystem, or downwards from a certain place (i.e from /home/shakey/ onwards....) then best to use

find /home/shakey -exec touch {} \;

or

find / -exec touch {} \;

This will touch all files from that point onwards - then just cron it for whatever time as hell666 has suggested.

Using touch * or touch /path/* will only touch files in the specified directory.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

stunnel4 daemon

If my web browser does not support SSL.This means that I can't connect like this "https://xxxxx". My question is how can i make a stunnel4 daemon in client mode ? like when i connect to "http://localhost:3000" in the web browser i am navigating througth "https://www.randomweb.com". I need to know... (0 Replies)
Discussion started by: pepeleches
0 Replies

2. Programming

Daemon

i want to write a daemon service which listens the 8080 port and write down all the details in one file. How can i do this ? (2 Replies)
Discussion started by: santosh123
2 Replies

3. Programming

How to write daemon?

Hi , I want to know how to write a daemon process. I also want to know the concept behind daemon processes. Any material or sample program will be great :) . Thanks in advance -sg (2 Replies)
Discussion started by: sg6876
2 Replies

4. AIX

rsync daemon

Does anyone out there use rsync on AIX 5.2, I've installed and would like to run in server mode, I've setup in services and inetd.conf and refreshed inetd. The rsync daemon however does not start, I've also tried rsync --daemon, this just returns to the # prompt. The rsync command itself appears to... (1 Reply)
Discussion started by: gefa
1 Replies

5. Programming

Creating a Daemon

how to convert a c program into a Daemon. thanks in advance svh (2 Replies)
Discussion started by: svh
2 Replies

6. Shell Programming and Scripting

daemon scripts

Hello, id like to know how can i do for making my script a daemon. Im not sure, but once , i might read about a "daemon" command. Thats true? Whats it for? It isnt in my man. (2 Replies)
Discussion started by: Jariya
2 Replies

7. Programming

Daemon...Zombie?? Please help me

Hello, i am very very puzzled, im doing this project for school, its a deamon logger, but anyways I'm supposed to run the daemon, let it run on the backgroun, and then run a different program (from command like prompt). but when i run my daemon, it never goes back to the nova> prompt. :( i dont... (3 Replies)
Discussion started by: Kacyndra
3 Replies

8. Shell Programming and Scripting

Creating a Daemon??

How in the world do you create a daemon and get it to start with a startup script? could someone tell me in detail im going nuts...thanks (1 Reply)
Discussion started by: nmajin
1 Replies

9. Programming

daemon

I want to write background running program. How to use daemon function. Please send me source code. Thanks. (1 Reply)
Discussion started by: bat_oyu
1 Replies
Login or Register to Ask a Question