Terminal – How do I automate / start a & # 39; Brew Cask Upgrade & # 39; as a cron job?

I want to run brew cask upgrade in a cronjob, but it prompts for a password.

If I do the job as root All permissions are screwed up.

How do I run this command in a cronjob environment? I use zsh,

~ brew cask upgrade
==> Casks with `auto_updates` or `version :latest` will not be upgraded
==> Upgrading 2 outdated packages:
java 13.0.1,9:cec27d702aa74d5a8630c65ae61e4305 -> 13.0.2,8:d4173c853231432d94f001e99d882ca7, keepassxc 2.5.2 -> 2.5.3
==> Upgrading java
==> Downloading https://download.java.net/java/GA/jdk13.0.2/d4173c853231432d94f001e99d882ca7/8/GPL/openjdk-13.0.2_osx-x64_bin.tar.gz
######################################################################## 100.0%
==> Verifying SHA-256 checksum for Cask 'java'.
==> Backing Generic Artifact 'openjdk-13.0.1.jdk' up to '/usr/local/Caskroom/java/13.0.1,9:cec27d702aa74d5a8630c65ae61e4305/jdk-13.0.1.jdk'.
Password:
==> Removing Generic Artifact '/Library/Java/JavaVirtualMachines/openjdk-13.0.1.jdk'.
tar xof /Users/tgdmead2/Library/Caches/Homebrew/downloads/57f2cd89482ecc0b0c6a7b3c3b0eff804f1cbd4d1e4688e86192566dfd9cfe2a--openjdk-13.0.2_osx-x64_bin.tar.gz -C /var/folders/_4/sysq2w_n7z18wwyk3q60bs618l7v6w/T/d20200120-60624-1l3ctvt
cp -pR /var/folders/_4/sysq2w_n7z18wwyk3q60bs618l7v6w/T/d20200120-60624-1l3ctvt/jdk-13.0.2.jdk/. /usr/local/Caskroom/java/13.0.2,8:d4173c853231432d94f001e99d882ca7/jdk-13.0.2.jdk
chmod -Rf +w /var/folders/_4/sysq2w_n7z18wwyk3q60bs618l7v6w/T/d20200120-60624-1l3ctvt
==> Moving Generic Artifact 'jdk-13.0.2.jdk' to '/Library/Java/JavaVirtualMachines/openjdk-13.0.2.jdk'.
==> Purging files for version 13.0.1,9:cec27d702aa74d5a8630c65ae61e4305 of Cask java
🍺  java was successfully upgraded!
==> Upgrading keepassxc
==> Downloading https://github.com/keepassxreboot/keepassxc/releases/download/2.5.3/KeePassXC-2.5.3.dmg
==> Downloading from https://github-production-release-asset-2e65be.s3.amazonaws.com/52729242/24b86f00-3b0a-11ea-8156-1f09c6c4235c?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200120%2Fus-east-1%2Fs3%2Faws4_r
######################################################################## 100.0%
==> Verifying SHA-256 checksum for Cask 'keepassxc'.
==> Backing App 'KeePassXC.app' up to '/usr/local/Caskroom/keepassxc/2.5.2/KeePassXC.app'.
==> Removing App '/Applications/KeePassXC.app'.
==> Unlinking Binary '/usr/local/bin/keepassxc-cli'.
hdiutil attach -plist -nobrowse -readonly -noidme -mountrandom /var/folders/_4/sysq2w_n7z18wwyk3q60bs618l7v6w/T/d20200120-60624-mxd9go /Users/tgdmead2/Library/Caches/Homebrew/downloads/9d7be57716fe51f0f28a92d080e75ea122b641cd4b83ab41ce0c39fc5022c9e0--KeePassXC-2.5.3.dmg
mkbom -s -i /var/folders/_4/sysq2w_n7z18wwyk3q60bs618l7v6w/T/20200120-60624-o8rycr.list -- /var/folders/_4/sysq2w_n7z18wwyk3q60bs618l7v6w/T/20200120-60624-1g059j3.bom
ditto --bom /var/folders/_4/sysq2w_n7z18wwyk3q60bs618l7v6w/T/20200120-60624-1g059j3.bom -- /private/var/folders/_4/sysq2w_n7z18wwyk3q60bs618l7v6w/T/d20200120-60624-mxd9go/dmg.jxFSOY /var/folders/_4/sysq2w_n7z18wwyk3q60bs618l7v6w/T/d20200120-60624-vi3min
diskutil eject /private/var/folders/_4/sysq2w_n7z18wwyk3q60bs618l7v6w/T/d20200120-60624-mxd9go/dmg.jxFSOY
cp -pR /var/folders/_4/sysq2w_n7z18wwyk3q60bs618l7v6w/T/d20200120-60624-vi3min/KeePassXC.app/. /usr/local/Caskroom/keepassxc/2.5.3/KeePassXC.app
chmod -Rf +w /var/folders/_4/sysq2w_n7z18wwyk3q60bs618l7v6w/T/d20200120-60624-vi3min
==> Moving App 'KeePassXC.app' to '/Applications/KeePassXC.app'.
==> Linking Binary 'keepassxc-cli' to '/usr/local/bin/keepassxc-cli'.
==> Purging files for version 2.5.2 of Cask keepassxc
🍺  keepassxc was successfully upgraded!

Website – Cron Job has stopped working

I use a third party system.

The cron job has stopped working with the following error. Searched everywhere and apparently can't fix it!

PDOException: SQLSTATE (HY093): Invalid parameter number: no parameters were bound in /home/test/public_html/invoice/sparks/php-activerecord/0.0.3/vendor/php-activerecord/lib/Connection.php:337 stack trace : # 0 /home/test/public_html/invoice/sparks/php-activerecord/0.0.3/vendor/php-activerecord/lib/Connection.php(337): PDOStatement-> execute (Array) # 1 / home / test /public_html/invoice/sparks/php-activerecord/0.0.3/vendor/php-activerecord/lib/Table.php(218): ActiveRecord Connection-> query (& # 39; SELECT * FROM ...', Array) #2 /home/test/public_html/invoice/sparks/php-activerecord/0.0.3/vendor/php-activerecord/lib/Table.php(209): ActiveRecordTable->find_by_sql('SELECT * FROM… & # 39 ;, Array, false, NULL) # 3 /home/test/public_html/invoice/sparks/php-activerecord/0.0.3/vendor/php-activerecord/lib/Model.php(1584): ActiveRecord Table -> find (Array) # 4 /home/test/public_html/invoice/sparks/php-activerecord/0.0.3/vendor/php-activerecord/lib/Model.php(1564): ActiveRecord Model :: find_by_pk (Array, Array) # 5 /home/test/public_html/invoice/application/controllers/Cronjob.php(83): ActiveRecord Model :: find (& # 39; all & # 39 ;, Array) # 6 / home / test / public_html / invoice / system /core/CodeIgniter.php(532): Cronjob-> index () # 7 /home/test/public_html/invoice/index.php(310): require_once (& # 39; / home / test / p … & # 39;) # 8 {Main}

openSUSE: "Permission denied" error in the cron log file

using: openSUSE Leap 42.2

Contents of the /etc/cron.d/mysite file:

* * * * * /usr/bin/php /srv/www/mysite/cron.php >> /var/log/apache2/mysite.cron 2>&1

/etc/cron.d/ dir content:

/etc/cron.d # ls -ls
total 12
4 -rw------- 1 root root 142 May  7  2018 autologout
4 -rw-r--r-- 1 root root 289 Jan  8 14:33 mysite
4 -rw------- 1 root root 369 May  7  2018 seccheck

E-mail message:

Message 103:
From wwwrun@linux.suse  Wed Jan  8 18:52:01 2020
X-Original-To: wwwrun
Delivered-To: wwwrun@linux.suse
From: "(Cron Daemon)" 
To: wwwrun@linux.suse
Subject: Cron  /usr/bin/php /srv/www/mysite/cron.php >> /var/log/apache2/mysite.cron 2>&1
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
Precedence: bulk
X-Cron-Env: 
X-Cron-Env: 
X-Cron-Env: 
X-Cron-Env: 
X-Cron-Env: 
X-Cron-Env: 
X-Cron-Env: 
X-Cron-Env: 
Date: Wed,  8 Jan 2020 18:52:01 +0100 (CET)

/bin/sh: /var/log/apache2/mysite.cron: Permission denied

mysite.cron log file

ls -la /var/log/apache2/mysite.cron
-rw-rw-rw- 1 wwwrun www 953 Jan  8 14:08 /var/log/apache2/mysite.cron

How can you fix this?

To run

/usr/bin/php /srv/www/mysite/cron.php >> /var/log/apache2/mysite.cron 2>&1

from the terminal as root, runs well, without authorization errors.

Linux cron debug is not running

I have a problem running the scheduling in Cron.
my crontab -e:

* * * * 1,5 /usr/local/bin/python3.7 /pyscripts/scripts.py > /pyscripts/logs/scripts.log

It's just not going
The generated log (/var/log/cron.log) shows how I was or how I did not understand it correctly:

https://gist.githubusercontent.com/braganetx/a05c8b7257df79305dd1b79008323011/raw/8aec453a74566e8872608d1705f05004c1e12e5e/log

Note: I essentially stated that the size was not specified here.

The funny thing is that if I run the same manual execution command on the terminal: /usr/local/bin/python3.7 /pyscripts/scripts.py > /pyscripts/logs/scripts.log It works normally.

How to create a cron job in webmin that works just like the wget command in cpanel

I want to get a cron job in WebMin like this cron job that I have in a cpanel server that is:

wget https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxx/transactions > /dev/null 2>&1

I would like to accept this command and include it in webmin. I am currently in the Scheduled Cron Jobs section:

Enter image description here

But I can't understand what's going on here. How can I create something that I'm already working on on my other cpanel server? (This command works every 30 minutes to get a URL.)

Thank you very much.

magento2.3.2 – cron jobs then stopped working at some point

It doesn't seem like the cron job is doing anything. I keep getting warnings in the admin area that the indexes are invalid. The crontab file is as expected. The emails are also not sent.

#~ MAGENTO START 
* * * * * /opt/plesk/php/7.2/bin/php /var/www/vhosts/steamspeed.com/httpdocs/bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule" >> /var/www/vhosts/var/log/magento.cron.log
* * * * * /opt/plesk/php/7.2/bin/php /var/www/update/cron.php >> /var/www/httpdocs/var/log/update.cron.log
* * * * * /opt/plesk/php/7.2/bin/php /var/www/httpdocs/bin/magento setup:cron:run >> /var/www/httpdocs/var/log/setup.cron.log
* * * * * /opt/plesk/php/7.2/bin/php /var/www/httpdocs/bin/magento php indexer:reindex
#~ MAGENTO END 
* * * * * date >> ~/cron-test.txt

So I added this cron-text.txt job and added the date and time to this txt file.

~$ cat cron-test.txt
Tue Dec 24 01:30:01 UTC 2019

My cron configuration is currently set to the default settings. Any suggestions on why nothing seems to be happening?

Standard Cron settings

cron – / bin / rm: invalid option – & # 39; ^ M & # 39; if the command is executed as a cronjob

I run this command every hour to clean files:

# crontab -l
MAILTO=notify@localhost
0 */1 * * * find /var/www/tmp/ -name "*" -mmin +60 | /usr/bin/xargs /bin/rm -f -R

But every time the cronjob runs, an email with this error message is sent to my email account:

/bin/rm: invalid option -- '^M'

Running the command manually works fine:

find /var/www/tmp/ -name "*" -mmin +60 | /usr/bin/xargs /bin/rm -f -R
# ok

What does this error message mean and how can I fix it?

Greetings,

magento2 – Cron Task problem

I recently deleted my child design that was created based on Blank and installed a new design that I bought in the store. However, I noticed that my previous theme still does cron tasks. Image.jpg is created regularly in / pub / static / frontend / Vegetus / vegetus_theme / ru_RU / Magento_Catalog / images / product / placeholder,
How can I solve this problem?

Cron error: sales_send_order_emails has an error: No such entity

I have these errors in cron.log:

main.ERROR: Cron Job sales_send_order_emails has an error: No such entity with cartId = 0.

We also have a problem with email confirmations that are not sent. We use a third-party SMTP extension.

What is this bug about and is there a solution to fixing this bug? Does this error possibly have something to do with unsent emails?