On 04/03/12 17:42, محمد الجداوي wrote:
Hi there. I made a cron for operating
/clean_sandbox.py/ every 6 hours,
I made a modified copy from /clean_sandbox.py/ for me and uploaded it to
my account on toolserver (outside the pywikipedia folder).
The problem i face is that i can't write the proper code, I made this code:
#!/bin/sh
#$ -j y
#$ -o /dev/null
$HOME
python clean_sandbox.py -lang:"ar" -family:wikipedia
But it didn't work.
In which folder?
I suspect you are getting that run in the wrong folder.
Moreover, that $HOME there seems useless.
So, let's assume it's in at /home/name/local_clean/clean_sandbox.py
First step, check manually that it works:
cd /home/name/local_clean/
python clean_sandbox.py -lang:"ar" -family:wikipedia
Does it run? Do you have any problems for eg. not finding the rest of
pywikipediabot?
Then, when creating the script, make it run in that folder:
#!/bin/sh
#$ -j y
#$ -o /dev/null
#$ -l h_rt=00:10:00
#$ -l virtual_free=20M
#$ -wd /home/name/local_clean/clean_sandbox.py
python clean_sandbox.py -lang:"ar" -family:wikipedia
I'd also recommend you to not run it with -o /dev/null the first time,
so you can see the output files if something were wrong.
(I also added there a time limit of 10 minutes to clean the sandbox, and
an arbitrary memory size of 20M, in line with Merlissimo guidelines)
-wd specifies the working _directory_ and not a file. It's needed if you use relative
path names as your script does.
Joining the error stream into the standard output stream and writing both to /dev/null
isn't a good idea if you are searching for an error cause.
Merlissimo