How ro write the ngc path and file name to a logfile

More
8 years 7 months ago #107409 by Earlton2
I use a script to load linuxcnc. I then manually File>Open or File>Recent the ngc file I wish to run. Is there any way to save the name of that ngc file to a log file, either from a g-code (msg,... ) etc, or a post script capture from a data file. I found the path and file listed in Machine > Show Linuxcnc status, but I don't know where that data is held or what to call linuxcnctop with, should I then be able to "| grep file" on it's output.
Code:
#!/bin/bash # log file for date stamps cnclog=/home/cnc/cnc-docs/SKIDDAW/linuxcnc/eaicnc.log echo "run linuxcnc after disabling audio and ethernet" sudo /etc/init.d/network-manager stop amixer set Master mute echo "Start: $(date)" >> $cnclog linuxcnc /home/cnc/linuxcnc/configs/EAI07TPCPWM/EAI07TPCPWM.ini sudo /etc/init.d/network-manager start amixer set Master unmute echo "Stop: $(date)" >> $cnclog

Please Log in to join the conversation.

More
8 years 7 months ago #107424 by andypugh
The last-opened file is automatically saved to a log file, that is how Axis knows what the recent files are.

Here is a hack to Axis that automatically opens that file:

forum.linuxcnc.org/21-axis/8700-opens-on...st-created-file#8759

Please Log in to join the conversation.

More
8 years 7 months ago #107451 by Earlton2
Thanks Andy, I never thought to look for "." files nor would I have looked in USER. This is the line I added to my startup script so I now save the path and name of the last ngc file along with the time I spent during the run.

cat ~/.axis_preferences | grep recent | awk '{print $3}' >> $cnclog

Please Log in to join the conversation.

Time to create page: 0.794 seconds
Powered by Kunena Forum