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

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

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



Apr 18, 2000, 4:50 PM

Post #1 of 2 (1272 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?


Apr 20, 2000, 7:14 AM

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


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 -->

$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.


[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