• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Cron job help!

SaigonK

Diamond Member
Hello,

I am noticing that one of my folders in my gallery keeps disappearing. (Using coppermine) its a bug and they dont have a fix so that sucks. its the edit folder and so when it does go away, people cant upload pics anymore.

Anywho, I was thinking to cure it temporarily, i could run a cron job to check for the folder and then create it if it isnt there and change its permissions to 777.

Anyone use thrillhost and have a way with their cron menu?
Or maybe pass on an idea of how to do this?

my folder is:

/public_html/gallery/albums/edit/

under:

/public_html/gallery/albums/
 
If you can get to a command line it would be easy enough.

Make a simple script to make the folder and set permissions, and stick it somewere convienent.
#! /usr/bin/env bash
if ls /path/to/edit/folder
then exit
else
mkdir /path/to/edit/folder
chmod 777 /path/to/edit/folder
fi

Then make a crontab, or edit the system's crontab. Each user can have their own crontab and there is a system one. The format is the same between them, however the system wide one has a extra column so that you can tell it what user you want use to execute the command.

The columns go like this:
minute, hour, day of the month, month, day of the week, the user if your editing the system wide crontab, and then the command.

So say you name that script "checkeditfile" and made it executable and stuck it in your user's ~/bin directory. Then to run it every 5 minutes to check on the file you add this line to your user's crontab entry. (man crontab, man 5 crontab, for details)

5 * * * * ~/bin/checkeditfile

Of course after you set it up you test to make sure that it works.

 
Back
Top