littlebizzy / slickstack

Lightning-fast WordPress on Nginx
https://slickstack.io
GNU General Public License v3.0
638 stars 112 forks source link

10-cron-weekly #57

Closed Bronislawsky closed 4 years ago

Bronislawsky commented 4 years ago
At Line 155, the IF statement,  the content has been commented out, 
if then fi     cannot be empty, it spits an error,  , suggestion, just add something like echo ""

./10-cron-weekly: line 157: syntax error near unexpected token `fi'
./10-cron-weekly: line 157: `fi'
Bronislawsky commented 4 years ago
In the same time, 
12-cron-monthly  gives error   ERROR 1046 (3D000) at line 1: No database selected

13-cron-sometimes too  gives
./13-cron-sometimes: line 137: syntax error near unexpected token `fi'
./13-cron-sometimes: line 137: `fi'
jessuppi commented 4 years ago

Okay the comment is now removed from the 13-cron-sometimes if statement, and SS_INTERVAL_ENCRYPT default set to sometimes in the ss-config-sample boilerplate file:

Ref: https://github.com/littlebizzy/slickstack/blob/master/13-cron-sometimes.txt Ref: https://github.com/littlebizzy/slickstack/blob/master/ss-config-sample.txt

10-cron-weekly comment also removed:

Ref: https://github.com/littlebizzy/slickstack/blob/master/10-cron-weekly.txt

So this means ss-optimize and ss-encrypt are now fully automated for SlickStack servers that have intervals enabled. We had previously kept those 2 scripts purposefully disabled while more testing was happening.

jessuppi commented 4 years ago

12-cron-monthly gives error ERROR 1046 (3D000) at line 1: No database selected

I'm not sure what is going on with this one, however. Will need to do most testing or get more feedback, thanks!

Bronislawsky commented 4 years ago
The 12--cron-monthly comes from ss-purge 

## manually delete all WP transients from database ##
mysql --execute="DELETE FROM ${DB_PREFIX}options WHERE option_name LIKE ('%\_transient\_%');"

I beleive by adding the ${DB_NAME} would do the trick

mysql --execute="DELETE FROM ${DB_NAME}.${DB_PREFIX}options WHERE option_name LIKE ('%\_transient\_%');"
jessuppi commented 4 years ago

Awesome, I haven't tested it but swapped in your code @Bronislawsky

Ref: https://github.com/littlebizzy/slickstack/commit/a125e7712a63700c0cccae827250827bae1b48d5

Looks like it broke a few days ago when updating to the latest "Bash Functions" in core scripts (the --database= field was removed from the mysql shortcut alias function).

Note: keeping SlickStack Bash Functions in a Gist for now until a better approach is found:

https://gist.github.com/jessuppi/3356c3031281872eb85120020fca4daa