Automatic House keeping in UNIX


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Automatic House keeping in UNIX
# 1  
Old 11-22-2001
Automatic House keeping in UNIX

I have a directory called 'test' which contains many junk files. I want to automate the clean-up task by removing all files which are older than one month. What would be the best option?
# 2  
Old 11-22-2001
Run a find command with the appropriate switched (see man find) and put the command in the crontab file. Make sure you carefully test first.......
# 3  
Old 11-23-2001
... or try to find "tmpwatch" software ...
# 4  
Old 11-24-2001
I'd suggest creating a macro (eg: clean_testdir).

Then as either root or the user which you are logged on as, do ...
crontab -e
This will open the either a copy of the existing crontab file for root/applicable user or a new file.
If you wish the macro to be run every night then you may do the following ...
45 23 * * * [location+name of macro mentioned above] > /dev/null 2>&1
This will run the macro at 23:45 every evening.

Hope that helps some. Smilie
I've just become familar with crontab is the past week Smilie

Cheers,
Cameron
.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. HP-UX

Automatic script to change the UNIX Password

Hi, we have around 50 users and every month we need to change the password manually once its expire. do we have any script to change the password automatically. OS -HP-UX Thanks in advance.. (6 Replies)
Discussion started by: periyasamycse
6 Replies

2. UNIX for Dummies Questions & Answers

UNIX Inquiry for Automatic Sending

Hi Everyone! I'm new with UNIX,so, sorry if this question seems really dumb.:( Anyway, I'd just like if it's possible to automatically inform someone (via mail or pop-up box or something) that a file has been recently uploaded/received to the UNIX box? If it is, any advice on how to get that... (1 Reply)
Discussion started by: jam04
1 Replies

3. Shell Programming and Scripting

Automatic FTP Script from windows to unix machine

Hi i need to FTP files from windows to unix(sun) machine using script. what are the scripts commands i need to use to transfer files Thanks (2 Replies)
Discussion started by: bmkreddy
2 Replies

4. UNIX for Dummies Questions & Answers

house keeping script

Hi, I am not aware whether any one has posted this early or not. I am creating a house keeping script in which I give the user two options: 1. creating a zip file. 2. removing all files given by user. Before taking any action I am asking user to enter full path of file or files to be... (7 Replies)
Discussion started by: Rakesh Bhat
7 Replies

5. UNIX for Advanced & Expert Users

unix automatic file transfer

Hello, I am a beginner with korn shell scripting. I have got a text file that gets produced every night and I need to transfer it to a windows shared area. Is there any command line script (e.g FTP) that I could use to transfer the file automatically without manual intervention everyday? Any... (4 Replies)
Discussion started by: tagem
4 Replies

6. UNIX for Dummies Questions & Answers

Automatic Tape Back-up under UNIX

Hi guys and gir.. emm hey guys! (only kidding girls) I have been asked to provide a tutorial on how to perform an automatic back up (to tape) for 23 sun sparc workstations networked using an ethernet setup under the UNIX operating system. Sounds easy enough to you... I've never ever seen... (4 Replies)
Discussion started by: maross
4 Replies

7. UNIX for Dummies Questions & Answers

Help! Newbie in the house!!!

Ok i was reading a book (sad) and it said to type in 'ftp' in Start/Run. I did but I know no commands for it. Can someone help me??? I also typed in 'telnet' and I know no commands for that either so I would like help on that... Thanx ..The Nutcracker Elite.. (4 Replies)
Discussion started by: The Nutcracker
4 Replies
Login or Register to Ask a Question