WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Cron Not Working in Slideshow Machine  (Read 903 times)

Offline abculatter_2

  • WikiUser
  • *
  • Posts: 2
Cron Not Working in Slideshow Machine
« on: November 11, 2019, 01:34:17 PM »
So, first off, worry if this is not the right place for this. I'm new here, and didn't see anywhere else that seemed more appropriate.
I'm doing a work-trade for someone, trying to figure out how to get some old, free hardware to work as a dedicated slideshow screen that automatically boots to that slideshow when the machine is turned on.
I'm still relatively new to linux (used Mint as my primary desktop, until the harddrive failed and I never got around to replacing it) and I will say that TCL has been quite an interesting learning experience. However, I've gotten to a problem that I just cannot figure out, even after looking through some troubleshooting threads on google.

Specifically, I'm trying to use Cron to make the following slideshow.sh script run on startup:
Code: newbielink:javascript:void(0); [nonactive]
#!/bin/sh

feh -Y -x -q -D 5 -B black -F -Z -z -r /home/Pictures

Using the following command to set it to run at boot with Cron:
Code: newbielink:javascript:void(0); [nonactive]
crontab -e @reboot sh /home/tc/slideshow.sh/
However, cron seems to be refusing to create or execute that command. I have tried using just contab -e and putting the Cron command into the crontab file manually using the text editor, I have tried putting sudo in front of the crontab command and doing both of the above things, I have tried setting all the relevant folders and files to be readable, writable, and executable to all users. However, Cron seems to refuse to actually run the command that I give it, without giving any error to show that it has even attempted to do so. I have noticed that when I attempt to use crontab -l after a system reboot it gives the following error:
Code: newbielink:javascript:void(0); [nonactive]
crontab: can't open 'tc': No such file or directory

Using sudo -l produces a similar error:
Code: newbielink:javascript:void(0); [nonactive]
crontab: can't open 'root': No such file or directory

I honestly don't know how to interpret this error.
As an aside, it is a fresh install of CorePlus using the USB-HDD option, plus the wireless support. I have installed feh, (obviously) VLC, alsaconfig (I also have to make the same sort of thing with video, and ideally audio, though that's a whole other thing I'm not focusing on right now) and fluff.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 8257
Re: Cron Not Working in Slideshow Machine
« Reply #1 on: November 11, 2019, 01:53:48 PM »
Hi abculatter_2
Welcome to the forum. You don't need  cron  for this task. Create a file in your  /home/tc/.X.d  directory containing the following:
Code: [Select]
/home/tc/slideshow.sh &That file can have any name you choose. Upon rebooting, once the GUI comes up, it will execute the command in that file.

Offline abculatter_2

  • WikiUser
  • *
  • Posts: 2
Re: Cron Not Working in Slideshow Machine
« Reply #2 on: November 11, 2019, 02:07:49 PM »
That worked perfectly, thank you!

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 8257
Re: Cron Not Working in Slideshow Machine
« Reply #3 on: November 11, 2019, 04:56:54 PM »
Hi abculatter_2
You are welcome. I'd like to suggest you take an hour and read this fine book:
http://tinycorelinux.net/corebook.pdf
It will provide you with some insight in using Tinycore Linux.