CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Crontab to delete a directory

 



Kris
Deleted

Apr 18, 2000, 4:50 PM

Post #1 of 2 (515 views)
Crontab to delete a directory Can't Post

Is there a way to use crontab to delete a directory automaticly? What I was thinking was that if a person wanted to delete their directory, the perl script would write the directory to be deleted into a .txt file. Then another script would read the .txt and delete whatever directory needed to be deleted. After it was deleted, to stop errors it would erase that directory that needed to be deleted in the .txt file. Then you could set up crontab to go to the perl script and automate the process. Is that possible. If so how would you do that?


Cure
User

Apr 20, 2000, 7:14 AM

Post #2 of 2 (515 views)
Re: Crontab to delete a directory [In reply to] Can't Post

Hi

To use contrab to delete a directory->

make a script that removes the directory,
and add an entry for the script to the crontab.

The script that will delete a directory -->

#!/usr/bin/perl
$dir = 'cure'; #the name of the directory is cure
mkdir $dir,'0755';
chmod(0755, $dir);


To setup the crontab ->(use telnet)

<crontab> you can edit commands

with crontab -e (for vi - mode)
and crontab -l to see it.

Cure



[This message has been edited by Cure (edited 04-20-2000).]

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives