Forum Moderators: bakedjake
Unfortunately I have no information about the environment on the server where my web site resides and the ISP doesn't have any documentation available to the general hosting subscriber although I do have a control panel that allows me to set up a cron job.
I've tried using some standard Unix commands in a script but can't seem to make most things work and I don't have access to a Unix system to try things out. Things like #!/bin/sh give me an error so I guess I don't have access to the Bourne shell which is where most of my experience is.
I created the following file and made it executable:
-------------------
ls_count=`find $HOME/html/camera -name "Motion_*" -exec ls -1 "{}" ";"`
echo $ls_count
-------------------
It's giving me output so I know cron is working but when I try to use other commands such as grep or others I get errors. I'm assuming I need to know the path to these "other" commands. Or, maybe I'm just overlooking something.
I also know I could use the following:
-------------------
find $HOME/html/camera -name "Motion_*" -mtime +14 -exec /bin/rm -f "{}" ";"
-------------------
which would delete files that are more than 14 days old but I only want them deleted if more than 100MB is being used in the folder where the images are located
I know it isn' hard to do what I'm trying to do but it's been five years since I looked at Unix scripts and I don't have a system to even try things out on the command line.
I'm hoping someone out there with some experience can point me in the right direction.
Unfortunately I have no information about the environment on the server where my web site resides and the ISP doesn't have any documentation available to the general hosting subscriber
Then, the solution is simple: you need a new host.
Maybe if you tell them that, they will cough-up the documentation.
You're not overlooking anything. You're just having to guess as to what kind of system you are running on.
If you really want to beat yourself up that way, you're going to have to do a bit of probing in your cron jobs (do you have access to a command shell?) to figure out what you've got. Do a "uname -a", which will at least give you the kernel version and architecture. Maybe a "ls /bin" and "ls /usr/bin" to see what programs you have available.
"grep" is part of the essential Unix toolkit and should be located in /bin. Without "grep", I'd question whether you are even running on a Linux or Unix system.
Thanks....