Bypass crontab??


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Bypass crontab??
# 1  
Old 09-14-2018
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.
# 2  
Old 09-14-2018
After ssh login, you can backup the crontab with
Code:
crontab -l > crontab.bak
cat crontab.bak

If it looks like the offending one, then remove the crontab with
Code:
crontab -r

Later you can restore the crontab with
Code:
crontab crontab.bak

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

Last edited by MadeInGermany; 09-17-2018 at 05:11 AM.. Reason: Simplified crontab restore
# 3  
Old 09-14-2018
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"

Last edited by hicksd8; 09-14-2018 at 01:28 PM..
# 4  
Old 09-15-2018
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.
# 5  
Old 09-17-2018
See my my previous post (#2), how to backup, remove, restore the crontab.
Also you can edit the crontab with you favourite editor
Code:
/usr/bin/env EDITOR=/usr/bin/vi crontab -e

Moderator's Comments:
Mod Comment Neo: Changed Typo "EDITR" to "EDITOR" (Reference)
# 6  
Old 09-17-2018
Quote:
Originally Posted by MuntyScrunt
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.
Try logging in with ssh and typing this into the command prompt
Code:
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
# 7  
Old 09-17-2018
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.

Last edited by Corona688; 09-17-2018 at 07:33 PM..
These 2 Users Gave Thanks to Corona688 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to bypass rm command when there are no files to delete?

Hi, Below command works fine when we have other files apart from hello.txtls | ggrep -v hello* | xargs rm -rfBut, if there is only one file i.e hello.txt the rm command does not find anything to delete and the script hangs. While there could be trivial ways to check using if conditions if... (6 Replies)
Discussion started by: mohtashims
6 Replies

2. Shell Programming and Scripting

Finding 'ls' to bypass system alias

Heyas Just asking, is there a better to make sure the script will use the binary and not some alias? LS=$(locate "ls"|grep /bin/ls$ | head -n 1) Thank you. (7 Replies)
Discussion started by: sea
7 Replies

3. HP-UX

Bypass stale PE ?

Hello, I have an ancient HP-UX 11.11 system where I have a logical volume marked stale and I can't get it sync'd. I have tried lvsync and lvreduce/lvextend to no avail. It is just one 4Mb PE on the disk that I can't get current. # lvdisplay -v /dev/vg00/lvol5 | grep stale LV Status ... (17 Replies)
Discussion started by: port43
17 Replies

4. Shell Programming and Scripting

awk Division By Zero Bypass

Hi Friends, I don't understand why "a" is always being printed as zero, when I execute the following command. awk '{if($6||$8||$10||$12==0)a=b=c=d=0;else (a=$5/$6);(b=$7/$8);(c=$9/$10);(d=$11/$12); {print... (6 Replies)
Discussion started by: jacobs.smith
6 Replies

5. Shell Programming and Scripting

Script to bypass the password field

Hello all Im trying to write a script that can get past the "enter password" field.Coming to the details, Im planning to write a script that can actually check for the validity of certificates in websphere. There is a utility "keytool" that helps provide this information.However if we want to... (4 Replies)
Discussion started by: coolkid
4 Replies

6. Cybersecurity

authentication bypass vulnerability

what does it mean? I searched in google but I could not find a clear document that explain to me what does it mean. (1 Reply)
Discussion started by: programAngel
1 Replies

7. Solaris

can't bypass password authentication

I can able to SFTP from my web server unix to apps server unix end. but the other way from APPS server to Web server is still asking me the password. I have done same procedure both side. still i am having same problem. Any one help on this. thanks, regards (3 Replies)
Discussion started by: vijill
3 Replies

8. Shell Programming and Scripting

How can I bypass the Prompt in SFTP

I am on a sun solaris server and trying to create a script that will test if SFTP is up and running on a remote server (which could be unix or windows). My thought was to simply invoke sftp and if I get the prompt ofr "Password" then that is an indication that the service is running and I am... (2 Replies)
Discussion started by: pierluigi22
2 Replies

9. Shell Programming and Scripting

How to bypass error in shell script?

Hi again, I have a script that moves files based on filelist: ------------------------------ filelist1=./rated.txt for file in $(< $filelist1) do mv ./$file ./Backup/$file done ------------------------------ If the file in filelist is not found from the folder the script fails.... (1 Reply)
Discussion started by: tmikahan
1 Replies
Login or Register to Ask a Question