My experience of the #fediverse :

Year 1 (2023):
It feels a little lonely as 99% of my friends stayed on Big Tech platforms.

Year 2 (2024):
I start a blog - #TheFutureIsFederated - to explain the fediverse to "normies"... and I make a lot of new (techie) friends.

Year 3 (2025):
My techie friends encourage me to start self-hosting with #YunoHost... and I do! (GoToSocial, PeerTube, NextCloud...) I LOVE it.

Year 4 (2026):
I plan to buy a Heltec to try out off-grid mesh radio communication πŸ’β€β™€οΈ

About to create my first cron job. Wish me luck! πŸ˜…

#MySoCalledSudoLife #SelfHosting

@_elena Good luck, but what do you want to do? I have a cron job on my @yunohost server so that the server shuts down at night and restarts in the morning.
@souverain @yunohost restart dnsmasq at 10am every weekday πŸ˜…
@_elena don't forget the user πŸ˜‰
@_elena break a leg!

@PMFL seems to have worked... I just checked

crontab -l

anyway the real test will be to see if it works tonight... (I made last minute changes and I have it running every 12 hours. All fingers and toes crossed) πŸ˜…

@_elena @PMFL Have you tested it?
@tagomago @PMFL "spray and pray" is my approach πŸ˜‚ it will run every 12 hours so I'm eager to see what will happen tonight. I timed it so I can regain control of things... when my daughter is in school or when she's asleep πŸ’β€β™€οΈ

@_elena @PMFL Sure, I just like it to see how it runs before I leave it chillin’ on its own 😁 Also, you’d save some time by not waiting 12 hours to see what happens.

It’s also nice to redirect its output to a file (command >> filename 2>&1) to log what it does while you’re testing it, cause jobs may go wrong for many reasons: permissions, environment...

@_elena nice! cron is such a handy thing. I use it a lot.
You can do this!
@_elena surely you do it cool
Crontab.guru - The cron schedule expression generator

An easy to use editor for crontab schedules.

@syaochan fantastic recommendation, thank you! πŸ™

@_elena

I guess you know you can simulate a cron task with the "at" command.

@tanavit I didn’t know that… newbie and all πŸ˜… I’ll try it as soon as I’m back home (ran out for some food). And thank youuuu

@_elena

The "at" command allows to execute another command (usually a shell-script) once at a given time in the same context than cron.

@_elena Fingers and toes all crossed 🀞🀞
@_elena good luck! πŸ˜‰ It will be just fine! Oh, and yesterday I did install Cockpit on my @yunohost VPS. It's great for system management. https://apps.yunohost.org/app/cockpit Even web terminal works great, and YunoHost SSO works too!
YunoHost app store | Cockpit

@jan ooooh I know of Cockpit and I didn’t know it was available for YunoHost. Thank you for the heads-up Jan!
@_elena Also, also: https://crontab.guru/#5_8-20/3_*_*_* is such a friendly service to understand the magic of cronjob settings :) @jan
Crontab.guru - The cron schedule expression generator

An easy to use editor for crontab schedules.

@_elena I didn't know about support in YunoHost until yesterday! It's there...I'm building new NAS that will be powered by @yunohost and will run Cockpit, Immich for Photo storage. Will be fun!
@jan @yunohost you're tempting me to set up ANOTHER installation on my Raspi to try it out πŸ˜…
@_elena @yunohost yes! Just go with it! Will help if you want! ;-)

@_elena cronjobs are the best. all my bots depend on them! very reliable!

one thing that got me early on: any output from a script ran in a cronjob seems to be put in some log file. Left alone that log file can fill all the space in your system.

for reasons I don't fully understand this line fix that by stopping the logging:

MAILTO=""

@stefan

I add the following at the end of the cron job

' > /dev/null 2>&1 '

Ignore the ' at start and end. Can't get my markdown to show as code

It captures ALL output from STDOUT and STDERR and sends it to /dev/null (that is, nowhere)

@_elena

@daj @stefan thank you for the heads up! do I put that code on the same line as the cron job instructions?

@_elena

Yes, like this:

0 5 * * * bash ~/backups/backup.sh > /dev/null 2>&1

which runs mybackup at 5am each day.  You just need to be confident that your script has no errors, as you will never see them!  Or ensure your script outputs to a log of its own within the script

@stefan

@_elena @stefan
@daj

Of course, if you need/want a log to see why the script fails you can temporarily send the log wherever you want like ~/mylogs/cronlogs/oh-no.log (or permanently)

And later you can learn about logrotate to keep a certain amount of logs but not let it grow forever and fill up your drive.

@daj @_elena

for me the cronjob is a file I edit by calling "crontab -e" on my server.

so I then put MAILTO="" on it's own line.

What david is suggesting also sound good / better!

@stefan I'm intrigued what MAILTO in this context does.  I must dig deeper. Every day is a school day
@daj i found it on stackoverflow years ago and didn't investigate deeply. but has worked well for me!
@_elena it’s fine! Just don’t pick 1am local.
@dianshuo I picked weekdays only: 9am local (kiddo in school) and 9pm local (kiddo asleep) πŸ€—

@_elena I feel one of those is optimistic #parenting however :)

Anyway welcome to the world of scheduling.

@dianshuo oooh she's only 5, so she's ALWAYS fast asleep at 9pm. The optimistic part would be about the morning because of random illnesses / bugs circulating at school πŸ˜…

@_elena
You'll love it, absolutely.
Also, you'll start wondering why TF one needs to be geeky root to have such tool and why "ordinary people" know nothing about it (and grep, and...)
Next up: shell scripting.
Go Elena, you rule!

#MySoCalledSudoLife #SelfHosting

@DataKnightmare grazie!

E sto ancora sorridendo dopo aver ascoltato il tuo podcast (l'episodio di Pasqua). Mi hai fatto morire quando hai chiamato il garante irlandese il "Labradoodle di Big Tech" πŸ˜† Bravissimo! πŸ™Œ

@_elena
Il cristomadonio lo conosci giΓ , ti divertirai amche con gli algopirla e i tecnopaninari :)
(Un neologismo li seppellirΓ , semicit.)
@_elena Cron is a life-saver. I also use it to automatically update the base system at night and post an image at a specific time to my Pixelfed server 😊
@_elena Is this with the Mesh system?
Good Luck πŸ€

@_elena
I tried cron jobs and it drove me crazy even with an IT background ;)

All the best!

I fall in love with systemd timers which were much easier to handle/understand/debug to me.
If someday you want to try.

@jibec @_elena yes! totally agree with systemd timers
@_elena oh I would also suggest looking into systemd timers! I much prefer them to cronjobs.