How to crontab

Status
Not open for further replies.

ZodiacUHD

Patron
Joined
Aug 28, 2015
Messages
226
Hello guys, i really looked the whole forum and google, maybe i'm just too dumb and if that's the case, i apologize.

I wanted to add crontabs, specifically as shown in this guide: https://forums.freenas.org/index.php?threads/how-to-nextcloud-10-w-apache-php-and-mariadb.46111/

Let's take the first crontab as an example:

Code:
crontab -u www -e


I then proceed to simply paste this

Code:
*/15 * * * * /usr/local/bin/php -f /usr/local/www/apache24/data/nextcloud/cron.php


press ENTER and
Code:
 :wq 


I and up having this at the bottom of the shell
Code:
 
/tmp/crontab.pUQhT9b25O: 0 lines, 0 characters.								 
crontab: no changes made to crontab


Am i missing something?
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Are you in the jail when you did this or outside the jail? You need to be in the jail. Also, are you root? That's about all I can add... Good Luck, hope you get it working.
 

ZodiacUHD

Patron
Joined
Aug 28, 2015
Messages
226
Are you in the jail when you did this or outside the jail? You need to be in the jail. Also, are you root? That's about all I can add... Good Luck, hope you get it working.

Hey there, i am logged as root inside the jail when i try to add crontabs.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Someone correct me if I'm wrong but that looks like vi. IIRC the default editor in FreeBSD is set to vi and when you run crontab you open the default editor. This behavior can be changed to another editor if you choose by changing the environment variable in the jail or you can learn vi commands and finish the edit.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I personally like "ee" for my editor.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
I personally like "ee" for my editor.
Same here. No need for the power and complexity of vi for simple file edits.

I better put the flame suit on as I'm sure the vi advocates will be along shortly.

"How dare you dis the vi?!!!"
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Same here. No need for the power and complexity of vi for simple file edits.

I better put the flame suit on as I'm sure the vi advocates will be along shortly.

"How dare you dis the vi?!!!"

Hell yeah! vi is simple and intuitive. All these other crap text editors cause me to have random "ZZ" and other characters in them. So annoying...

of course, this could just be my pre-election buzz kicking in and distorting my judgment.
 

ZodiacUHD

Patron
Joined
Aug 28, 2015
Messages
226
Thank you very much, i ended up changing my editor to nano with
Code:
setenv VISUAL /usr/local/bin/nano

Thanks again to everyone :)
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Uh oh, that's going to bring out the torches and pitchforks! (I use nano too--I don't need my text editor to be a full-fledged operating system).
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
Or capable of running a weak AI
 
Status
Not open for further replies.
Top