Hello all!
I have what I'm certain is a simple issue.. I've put together two Raspberry Pis to use as thin clients to connect to Windows (shudders) Server Data Center edition. The issue as of now has nothing to do with Microblasphemy, fortunately. (ONE dod gamned program that is PARAMOUNT to the daily operations will ONLY run on Windows or Mac. I don't have anywhere close to the time necessary to mess with Wine and as far as I can tell there is no alternative that has all we need. It's "Phorest" salon software. I had Debian Stretch on this thing originally and it all worked BEAUTIFULLY. Painstaking effort I put into getting it all nice, pretty and autonomous..)
I'm using rdesktop on the pis, have the relative settings correct on the server.
My issue is that cron refuses to run a shell script at a scheduled time (or even every minute if I put all *'s for testing).
Cron is running, I added it to the startup script rc.local. I greped it at every boot to make certain that it was running.
The script, rdp.sh, I've made is a simple one:
Code:
#!/bin/bash
#I just thought, as I'm typing this, that perhaps it should have been "/bin/sh"
rdesktop 192.168.0.21 -f -u breakroom
I've put it in /home/pi/bin, /etc/crond (I think, I'm not at my work bench right now) and every other folder I saw mentioned on any site anywhere that said anything about where these things should go. No dice.
If I type that command, verbatim, in a terminal - rdesktop fires up at breakneck speed and works like a beast. If I double click on the script, click on "run in terminal," it works like a beast. I made it executable with both
and
on another try while I was changing one variable at a time to see what the fudge I was doing wrong. No difference. Works from double click, not from crontab.
I've been using
to edit the cron table, though I've also tried "sudo crontab -e" as another changed out variable.
The lines I've tried in the crontab file are as follows:
Code:
* * * * * /home/pi/bin/rdp.sh
Code:
* * * * 1-6 /home/pi/bin/rdp.sh
#I was using this today, a Tuesday
Code:
* * * * 1,2,3,4,5,6 /home/pi/bin/rdp.sh
I alternated putting "pi" as the user between the times and paths even though I read in multiple places that this was unnecessary.
I have alternated putting the following right before the schedules:
Code:
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
Code:
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
Code:
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/home/pi/bin
Code:
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/home/pi/bin
This was all after trying all of this, but saving the script in the root folder and running it while logged in as another user without sudo privileges to keep other employees that like to mess with things they understand even less than I do. I've got about 9 hours solid invested in this single stupid issue.
I gave up on that.
I also at some point gave up on the pipe dream of running a script. So I tried just putting the command as a scheduled cron job..
Code:
* * * * * rdesktop 192.168.0.21 -f -u breakroom
Code:
* * * * * 'rdesktop 192.168.0.21 -f -u breakroom'
Code:
* * * * * "rdesktop 192.168.0.21 -f -u breakroom"
Code:
* * * * * rdesktop 192.168.0.21
Code:
* * * * * 'rdesktop 192.168.0.21'
Code:
* * * * * "rdesktop 192.168.0.21"
Code:
* * * * * pi rdesktop 192.168.0.21 -f -u breakroom
Code:
* * * * * pi 'rdesktop 192.168.0.21 -f -u breakroom'
Code:
* * * * * pi "rdesktop 192.168.0.21 -f -u breakroom"
As I said, I spent 9 hours on this project save 30 minutes that I took to run to wally world to get new 2.4 amp power supplies just in the off chance that the low power icon I was getting at the top right might have some magical effect on cron not working. Also read that this icon can pop up even when low voltage/amperage is not an issue.
Somewhere, deep in my memory I have what seems to be half a ghost image of a memory that somewhere I read that you have to run a command to update cron after altering crontab. I've read tons of places that it does so automatically.. I have no idea.
Does anyone have any suggestions? I may or may not have time to revisit this tomorrow, the day after or in the next decade the way things are going.. But I would greatly appreciate any help/suggestions/etc.. I'll read them on my phone when I get to go to the bathroom and try them as soon as I can.
Thanks!