nL cron script

Started by joejoe, October 26, 2019, 12:56:33 AM

Previous topic - Next topic

joejoe

Hi,



I have a script I am trying to run from cron on Debian/Ubuntu.


* * * * * joe /home/joe/winny/winny.lsp

The permissions of winny.lsp are 755.



Syslog looks like it is executing:


Oct 26 01:49:01 jsfccfow CRON[6574]: (joe) CMD (joe /home/joe/winny/winny.lsp)

The winny.lsp script contains:


(append-file "ltcbtc.txt" (println pairs (date (date-value) 0 "%y%m%d%H%M%S")))

The ltcbtc.txt file is already created and chmoded to 755.



I am not getting anything added to ltcbtc.txt file.



Anything I might be missing to get the nL script to run w cron?



Thank you! :-)

rrq

#1
* * * * * joe /home/joe/winny/winny.lsp A line like the above would be fine in /etc/crontab or in /etc/cron.d/something-or-other, but for a user's crontab line (crontab -e), you'd skip the "user" field:
* * * * * /home/joe/winny/winny.lsp It's of course all nicely documented in
$ man cron
hth

joejoe

#2
Hi and thanks ralph,



I had tried that as well but it still doesn't append the file.



Any way to check for why it might not be working? Thanks!

rrq

#3
A script file needs to tell which interpreter to use at it's first line, so it'd be like
#!/usr/local/bin/newlisp
(append-file "ltcbtc.txt" (println pairs (date (date-value) 0 "%y%m%d%H%M%S")))
if you have installed newlisp at there.



Alternatively you make an embedded executable with the script; something like
$ newlisp -x winny.lsp herbie ; chmod a+x herbie  and then use that in crontab.
* * * * * /home/joe/winny/herbie.

joejoe

#4
ralph,



thanks for the help!



my nL script file has this already at top:


#!/usr/bin/env newlisp

I can run it from the command line fine and it does it all.



I am almost ready to leave a nL process hanging just to make it done.?

rrq

#5
println ? did you mean string ?



btw, cron scripts are run in $HOME so it would append to $HOME/ltcbtc.txt

joejoe

#6
Working!



Moving the txt file and script to the home directory made cron all go!



You always share the best secrets ralph, thanks very much again for this!