LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-29-2021, 03:41 AM   #1
zahhak snake shoulder
LQ Newbie
 
Registered: Aug 2021
Posts: 16

Rep: Reputation: Disabled
crontab @reboot question


Hi everyone
I'm a new user here and to Linux
and here goes my first question

I have recently installed KDE plasma on my Kali, and it's great
but I have an issue that it reset its screen res to default every time I log in
I have tried different way to go about fixing this, but it didn't work
it doesn't bother me
I've made an alias for it using xrandr, and I change it every time in a sec
but what I don't understand is why my @reboot command in crontab don't work

this is my code
@reboot xrandr -s 5
and I made another code using my alias
@reboot res
and it says installing new crontab or whatever in my terminal
but neither work and nothing happens at reboot

What am I missing here?

Thanks guys

Last edited by zahhak snake shoulder; 08-29-2021 at 03:43 AM.
 
Old 08-29-2021, 04:57 AM   #2
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,963

Rep: Reputation: 271Reputation: 271Reputation: 271
Does
Code:
crontab -l
show it? Look at /var/log/cron for evidence of it trying to work. I put reboot stuff in /etc/rc.d/rc.local
(may be different on your system).
 
1 members found this post helpful.
Old 08-29-2021, 05:09 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
additionally use full path in crontab.
https://www.linuxquestions.org/quest...ad-4175614092/
 
1 members found this post helpful.
Old 08-29-2021, 06:14 AM   #4
kermitdafrog8
Member
 
Registered: Dec 2018
Location: Orlando, FL
Distribution: Slackware AARCH64 and X86_64
Posts: 334

Rep: Reputation: Disabled
crontab @reboot question

Doesn't @reboot work only if you actually reboot and not from a cold boot? Are you actually doing a shutdown -r now or reboot or coming from a cold shutdown?
 
1 members found this post helpful.
Old 08-29-2021, 08:56 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,703

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
cron jobs are normally not associated directly with the desktop as if running when actually logged in. Try

@reboot DISPLAY=:0 xrandr -s 5
 
1 members found this post helpful.
Old 08-29-2021, 10:43 AM   #6
zahhak snake shoulder
LQ Newbie
 
Registered: Aug 2021
Posts: 16

Original Poster
Rep: Reputation: Disabled
Thanks a lot, guys
 
Old 08-29-2021, 07:54 PM   #7
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,963

Rep: Reputation: 271Reputation: 271Reputation: 271
Please tell us what worked. I should have mentioned that the only environment variables supplied to a cron job are $HOME and a limited path, just /bin:/sbin:/usr/bin:/usr/sbin as I remember, not the path I have in /etc/profile or other initialization files. When I call a script via crontab the first command sets my usual path.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DIff B/w Crontab -l & crontab -e Tareq9959 Linux - Newbie 2 05-14-2013 08:27 AM
linux crontab vs unix crontab ytd Linux - General 2 08-09-2009 05:07 AM
replaced crontab, now should get crontab back to what it was raminn Linux - Newbie 2 10-20-2008 07:15 PM
man crontab(5) vs crontab(1) Canis Polaris Linux - Newbie 2 06-04-2008 04:03 PM
system-wide crontab in /etc/crontab ner Linux - General 2 11-18-2003 12:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration