M
M
moonbow2019-12-03 19:41:49
Automation
moonbow, 2019-12-03 19:41:49

Why does the script not run through the crontab file on macOS?

Access to the machine is only from under the user (via vnc). Is the following statement true in this situation:

Crontab needs to be run like this: sudo crontab
- suddenly there is some specificity for the poppy?

I wrote the crontab file according to the recommendations from here :
30 23 * * * /bin/bash /Users/user/autoclear.sh >> /tmp/debug_cron 2>&1
(numbers and * - minutes/hours/days/month/days of the week;
then - interpreter (bin/bash);
/Users/user/autoclear.sh - path to the executable file from the "root" /)
Redirecting the output to the debug_cron file shows that the task via cron does not start from the word at all
60e4d6d4169d4294519690.png
Scripts here

  • autoclear.sh
    #!/bin/bash
    
    echo "Autoclear"
    echo "====================================="
    echo "QA"
    
    # Completion of active processes
    killall node
    killall rethinkdb
    
    echo Clearing cash folders...
    cd ~/Library/Developer/Xcode
    rm -R DerivedData
    cd ~/stf
    rm -R rethinkdb_data
    
    echo Starting server...
    cd
    open -a Terminal.app ./serverstarter.sh
    cd ~/stf
    rethinkdb --bind all

  • serverstarter.sh
    #!/bin/bash
    
    echo "Serverstarter"
    echo "====================================="
    echo "QA"
    
    echo Starting server...
    cd stf
    bin/stf local --public-ip xxx.xxx.x.xxx --wda-path ../WebDriverAgent

    где xxx.xxx.x.xxx - некоторый IP-адрес

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
moonbow, 2019-12-04
@moonbow

It turns out that the .crontab extension is specified for the crontab file ! Fucking shame =)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question