command line link/unlink

Help with D-Star related issues
AF6VN
Posts: 821
Joined: Fri Jul 20, 2018 1:15 am

Re: command line link/unlink

Post by AF6VN »

Well... the half of that may be easy... I believe one gets an automatic unlink when one links to a different reflector.

That just leaves the command line to do the linking...

https://amateurradionotes.com/pi-star-n ... inelinking

Or do you mean you need help with what to put in when doing "crontab -e"

--
AF6VN
Dennis L Bieber
W8DSB
Posts: 30
Joined: Thu Jun 14, 2018 5:54 pm

Re: command line link/unlink

Post by W8DSB »

I was thinking it should look like:

59 19 * * 1 "pistar-link 024_A"'''

however I am not sure as I have not written any scripts for pi-star before
AF6VN
Posts: 821
Joined: Fri Jul 20, 2018 1:15 am

Re: command line link/unlink

Post by AF6VN »

W8DSB wrote: Sat Jul 20, 2019 12:30 am I was thinking it should look like:

59 19 * * 1 "pistar-link 024_A"'''

however I am not sure as I have not written any scripts for pi-star before
Again, refer to the link in my previous response -- your specification for the reflector is not correct

Then... https://linux.die.net/man/1/crontab and https://linux.die.net/man/5/crontab

I would suggest using

sudo crontab -e

to edit the root user crontab file; that will avoid the need to invoke sudo for each link command /in/ the file. Oh, and you may need to redirect command output to the bit-bucket due to the read-only file system.

--
AF6VN
Dennis L Bieber
User avatar
w7efs
Posts: 335
Joined: Sun Apr 22, 2018 4:26 pm

Re: command line link/unlink

Post by w7efs »

W8DSB wrote: Sat Jul 20, 2019 12:30 am I was thinking it should look like:
59 19 * * 1 "pistar-link 024_A"'''
...
There are 3 serious errors in your cron job:
1) don't use any quotes ... you have a set of double quotes and 3 single quotes for some strange reason.
2) as AF6VN points out, the reflector argument is incorrect.
3) the $PATH is different in a cron job than it is on the command line, so use the absolute pathname:

Code: Select all

59 19 * * 1 /usr/local/sbin/pistar-link ref024_a && sleep 3540 && /usr/local/sbin/pistar-link ref024_c
W8DSB
Posts: 30
Joined: Thu Jun 14, 2018 5:54 pm

Re: command line link/unlink

Post by W8DSB »

Thanks, I ended up using this:

59 19 * * 1 root /usr/local/sbin/pistar-link ref024_a
00 21 * * 1 root /usr/local/sbin/pistar-link ref024_c
Post Reply