Bypass crontab??

Hi there.

I've put something in crontab that my raspberry doesn't like, it's trying to draw a window before the graphics are ready after login.

Problem being after the error it throws me back to the login, so I can't log in.

There is only one user setup on this raspberry so I can't log in as someone else and edit the file.

ssh will connect from another machine, but no paths are set, so editing things is pretty difficult!

Is there a way to bypass crontab? Holding a key? Like windows used to do if you didn't want to autorun a cd?

Any ideas?
Thanks.

After ssh login, you can backup the crontab with

crontab -l > crontab.bak
cat crontab.bak

If it looks like the offending one, then remove the crontab with

crontab -r

Later you can restore the crontab with

crontab crontab.bak

This is "how to disable the crontab".
To be honest, I doubt that the crontab spoils your desktop login...

Which O/S are you booting?

Depending on which one, you might try alt-ctrl-F1 thru' alt-ctrl-F7 to try and get a command line terminal.

There's also a safe-mode hardware jumper on some pi models (Google that).
"RPi safe mode jumper"

The crontab is trying to run a graphical application, but it gets run before the desktop is initialised, therefore the app fails. At this point the boot process stops, there is no PATH, there are no os variables, there are no shares, no smb no cifs, no nothing.

This is also the case with ssh, so when I login I have the prompt, but the os is completely dumb. I have to know where every command is on disk, and I don't.

So surely the easiest way around this is to know where the offending crontab file is, nano/vim and sudo. Without Sudo I can't do anything.

The jumper sounds interesting, os is Jessie based, or at least Debian based. I'll look into that now. Thanks.

See my my previous post (#2), how to backup, remove, restore the crontab.
Also you can edit the crontab with you favourite editor

/usr/bin/env EDITOR=/usr/bin/vi crontab -e

Try logging in with ssh and typing this into the command prompt

PATH=/bin:/sbin:/usr/bin:/usr/sbin
export PATH

You should then be able to type in the commands without their full path names.

Andrew

This being a pi, you can remove the micro-SD card and put it in a different computer to edit the crontab and/or login files. Sometimes brute force is the simplest way.

2 Likes