Cron job help

Status
Not open for further replies.

dutchy_nl3669

New Member
Messages
21
Reaction score
0
Points
0
Hi,

I need some help setting up a cronjob. I got the cronjob working but with a "wget" code but it wont put the file it gets in the right location.
The code is:
"wget /home/XXX/public_html/sub_directory1/sub_directory2 ftp://*:*@11.22.33.44:21/the/right/directory/server.log"

The server log is downloaded from my location(the ftp link is then correct) to the "public_html" folder but it needs to go into "sub_directory2.

What is wrong with my code??

Next cronjob is how to execute a .sh file to update some stats. I know the location of that .sh file, I just dont know the right command.

This all needs to be done once a day, so the 5 minute between these jobs are not a problem.

For security reason I changed username and folder directories, but you get my drift here(I hope)

Hope someone can help me.

greetz dutchy
 
Last edited:

vv.bbcc19

Community Advocate
Community Support
Messages
1,524
Reaction score
92
Points
48
I think Shell scripts are not allowed according to ToS.
But to execute a cron job, this is the correct way to do_On free hosting, cron jobs are only allowed to run once every five minutes for each user. This limit includes all of a user's cron jobs. For example, if a user has two jobs, each can only run on average every ten minutes.
Examples

Run 'foo.php' every Sunday, capturing output:

* * * * Sun /usr/local/bin/php $HOME/foo.php >> $HOME/log/foo.txt 2>&1

Run 'email.php' every day at midnight:

0 0 * * * /usr/local/bin/php $HOME/email.php

Run job1 every 10 minutes (except on the hour), job2 on the hour (except at midnight), job3 at midnight (except Monday) and job4 at midnight on Monday, capturing output:

10-50/10 * * * * $HOME/bin/job1 >> $HOME/log/jobs.txt 2>&1
0 1-23 * * * $HOME/bin/job2 >> $HOME/log/jobs.txt 2>&1
0 0 * * 0,2-6 $HOME/bin/job3 >> $HOME/log/jobs.txt 2>&1
0 0 * * Mon $HOME/bin/job4 >> $HOME/log/jobs.txt 2>&1

With 4 jobs that are to run every 5, 10, 15 and hourly, there will be many conflicts when multiple jobs run at the same time. Resolve this conflict by skipping a more frequent job when it would run at the same time as a less frequent job, which is easily done using commas to specify a set of run times:

5,25,35,55 * * * * $HOME/periodic/5m
10,20,40,50 * * * * $HOME/periodic/10m
15,30,45 * * * * $HOME/periodic/15m
0 * * * * $HOME/periodic/hourly

Or, just to obfuscate things a bit:

5/30,25/30 * * * * $HOME/periodic/5m
10/30,20/30 * * * * $HOME/periodic/10m
15-45/15 * * * * $HOME/periodic/15m
0 * * * * $HOME/periodic/hourly
 

dutchy_nl3669

New Member
Messages
21
Reaction score
0
Points
0
Hi vv.bbcc19,

I think were missing the point here. I know the time table for the cronjob. I just want to know why it's not putting the file were I want it to go.

As for Shell scripts, I haven't a clue if this is one. Check this page dtor and if so I will have to delete this.

greetz dutchy
 
Last edited:

dutchy_nl3669

New Member
Messages
21
Reaction score
0
Points
0
I think Shell scripts are not allowed according to ToS.

I have been looking into the ToS and found:
* Script Hosting: Space provided by x10Hosting is to be used to create a functional website, we do not allow bots, content scrapers, or any other script that runs continuously on your account. Any scripts that are executed via cron or manually must be directly related to your website.
This script shows me and my clan members our progress from a match. It doesn't run continuously, it is only be updated once a day with 2 cronjobs, 1 to get the log file, 1 to use that logfile to update the stats(after I get this to work properly). The rest of the day it sits still only to be looked at.
As this is directly related to my clan site, I think this is allowed.

So my question/problem from the first post still stands, can someone help me to find out what I'm doing wrong here....

greetz dutchy
 
Last edited:

dutchy_nl3669

New Member
Messages
21
Reaction score
0
Points
0
isn't there anyone that can help me here??

greetz dutchy

PS. why cant I post in other posts here??
 
Last edited:
Status
Not open for further replies.
Top