Weekly DC Stats scripts

Help with projects and applications, client configuration, system software tweaks.
The pinboard for cheat sheets.
Skillz
Site Admin
Reactions:
Posts: 1720
Joined: Sun Sep 15, 2019 3:03 pm

Re: Weekly DC Stats scripts

Post by Skillz » Mon Jan 02, 2023 3:14 pm

Does the script have to be run multiple times for a reason? Like are there instances where the script fails to do what it's supposed to do so running it every minute for an hour guarantees success at least once?

crashtech
TAAT Member
Reactions:
Posts: 1484
Joined: Sun Sep 15, 2019 4:45 pm
Location: Idaho, USA

Re: Weekly DC Stats scripts

Post by crashtech » Mon Jan 02, 2023 5:29 pm

No, I just want it to run once. Maybe my syntax is wrong, I need to check it. I assumed that is was failing and retrying, sounds like I am wrong about that. I only want it to run one time a week, at 3AM on Sunday morning.

I will put the whole path of the output file as well.

Skillz
Site Admin
Reactions:
Posts: 1720
Joined: Sun Sep 15, 2019 3:03 pm

Re: Weekly DC Stats scripts

Post by Skillz » Mon Jan 02, 2023 5:46 pm

Well the cronjob should look like this;

0 3 * * sun
or
0 3 * * 7

That's at 3am every Sunday, every week. It will only run once.

Cool site I use to check the cron scheduling is here:
https://crontab.guru/

Very useful for taking the "work" out of setting up a cronjob.

crashtech
TAAT Member
Reactions:
Posts: 1484
Joined: Sun Sep 15, 2019 4:45 pm
Location: Idaho, USA

Re: Weekly DC Stats scripts

Post by crashtech » Sun Jan 08, 2023 12:35 pm

Meh. Now I have something that is slightly closer to working. It runs, but it creates a blank text file instead of writing the output into it.

Code: Select all

0 3 * * 0 ./home/garage/Desktop/Weekly_Stats_Scripts/weekly_stats_dump.sh > /home/garage/Desktop/Weekly_Stats_Scripts/weekly_stats_dump_output.txt
There doesn't seem to be a problem with permissions. Running the command as a normal user from the root directory is successful.

Skillz
Site Admin
Reactions:
Posts: 1720
Joined: Sun Sep 15, 2019 3:03 pm

Re: Weekly DC Stats scripts

Post by Skillz » Sun Jan 08, 2023 8:48 pm

It might be better to write in the script to output the results to a file.

crashtech
TAAT Member
Reactions:
Posts: 1484
Joined: Sun Sep 15, 2019 4:45 pm
Location: Idaho, USA

Re: Weekly DC Stats scripts

Post by crashtech » Sun Jan 08, 2023 11:05 pm

When I run that in a terminal window, it does write the results to the file specified. So if there is a better way, I don't know how.

Skillz
Site Admin
Reactions:
Posts: 1720
Joined: Sun Sep 15, 2019 3:03 pm

Re: Weekly DC Stats scripts

Post by Skillz » Mon Jan 09, 2023 10:36 am

I mean without having to use > to dump the output in the terminal to a file.

I'll check it out tonight and do some research on how to implement an output within' the script code directly. Gotta be a way.

StefanR5R
TAAT Member
Reactions:
Posts: 1552
Joined: Wed Sep 25, 2019 4:32 pm

Re: Weekly DC Stats scripts

Post by StefanR5R » Mon Jan 09, 2023 3:08 pm

Remove the dot before /home in the crontab line.

crashtech
TAAT Member
Reactions:
Posts: 1484
Joined: Sun Sep 15, 2019 4:45 pm
Location: Idaho, USA

Re: Weekly DC Stats scripts

Post by crashtech » Mon Jan 09, 2023 5:12 pm

StefanR5R wrote:
Mon Jan 09, 2023 3:08 pm
Remove the dot before /home in the crontab line.
Okay I will. Initially I did not have it in there, I'll take it back out.

StefanR5R
TAAT Member
Reactions:
Posts: 1552
Joined: Wed Sep 25, 2019 4:32 pm

Re: Weekly DC Stats scripts

Post by StefanR5R » Sun Jan 15, 2023 12:14 pm

Opening post edited:

weekly_stats_dump.sh:
– Don't look for OGR-28 updates anymore.

fah_weekly_stats_dump.sh:
– Use firefox's user agent string in the HTTP requests which are issued via the "links" browser.
– Insert a small delay between HTTP requests, to go easy on the folding.extremeoverclocking.com web server. This script issues only 3…4 requests though, so it's not been a big deal.

Post Reply