Skip to main content
7 votes
Accepted

Passwordless mysqldump via shell script in /etc/cron.daily

Solved with the help of this answer. cron doesn't know the path to ~/.my.cnf, so as per the MYSQL documentation you need to specify the path to the .my.cnf file. The proper passwordless mysqldump ...
Vila's user avatar
  • 223
6 votes

Date range query for past 24 hour in Mongo shell

db.system.profile.find({ "timestamp" : { $gte: new Date(new Date().setHours(00,00,00)) , $lt : new Date(new Date().setHours(23,59,59)) } })
PetitCitron's user avatar
5 votes

"connection failed" error for pg_cron extension

I probably had .pgpass with wrong permissions or wrong place (as @PhilW suggested) but I found completely different way which worked for me (btw, I just removed .pgpass file). Solution was simply ...
Oto Shavadze's user avatar
3 votes
Accepted

mysql backup password without root home

What's the best way to provide a MySql ... password Using a separate configuration file, as described in the Manual. What's the best way to provide a MySql root password You should not use any high-...
Phill  W.'s user avatar
  • 9,480
3 votes

cron command running postgres at high cpu

You've been hacked. There has been a recent trend for crypto miners to hide their mining software by naming it 'cron'. It is not the actual cron. You probably had a poor password for your ...
jjanes's user avatar
  • 41.3k
3 votes
Accepted

Query to delete all rows which are not referenced in any other tables

I don't think you can write a single query, but you can write a query to get the list of tables that refer to the images table, and then you can do a second task which deletes the rows from images ...
dbdemon's user avatar
  • 6,479
3 votes

PostgeSQL Schedule Jobs

Any job scheduler can satisfy your needs. Either way a client will trigger an SQL statement. If you insist that PostgreSQL should be the service that triggers the statement then you can use pg_cron ...
Sahap Asci's user avatar
  • 3,094
2 votes
Accepted

Pg_cron crontab log issue

To schedule jobs from the db server we'll need to enable trust authentication in pg_hba.conf for the user running the cron job. We'll also need to either run UPDATE cron.job SET nodename = '' to make ...
Martina Muscariello's user avatar
2 votes
Accepted

Programming query execution Postgres

There is no task scheduling functionality built into PostgreSQL. You can use an extension like pg_cron, but I don't know how easy it is to build that on Windows. The simplest way would probably to ...
Laurenz Albe's user avatar
  • 56.4k
2 votes
Accepted

Using pgdump_all and cron

The pg_hba.conf line local all all trust allows local connections with trust authentication, that is, without a password. That is why your backup script is working ...
Laurenz Albe's user avatar
  • 56.4k
1 vote

Using pgdump_all and cron

".pgpass" is typically a hidden file in your user's home directory (not in the root as your notation suggests--if you refer to the fact that crontab is for the root user and runs the script ...
jjanes's user avatar
  • 41.3k
1 vote

mysql backup password without root home

Use mysql_config_editor mysql_config_editor set -G project_name -u database_name -p -h localhost Notes The -p prompts for the password -P 3306 for port (default 3306) -h could point to a remote ...
Rick James's user avatar
  • 79.4k
1 vote
Accepted

MongoDB scripts triggered by cron - how to achieve reasonable password security

First.. It's better to use --eval='command' and not echo a string to mongo... What comes to that password, you could use -p $(cat /etc/secret/password) and files chmod is like 0400
JJussi's user avatar
  • 5,733
1 vote

"connection failed" error for pg_cron extension

not sure how to "tell" to libpq that for this user, for this host and DB read this .pgpass file. You don't need to. The .pgpass file is always read when the account that "owns" it ...
Phill  W.'s user avatar
  • 9,480
1 vote

Supabase postgres cron job not working special case

I solved my problem! You can check that in those threads where i asked! And shared many elements! https://github.com/supabase/supabase/issues/1703 https://github.com/supabase/supabase/discussions/479 ...
Mohamed Allal's user avatar
1 vote
Accepted

Set crontab backup job for Mariadb Databases from 1 remote server to another

Your task will not fit into one command. You need a bash script. If your backup server has FTP then here is a good script . If FTP is not installed on the server, and you do not want to bring it up, ...
Ivan's user avatar
  • 584
1 vote

Integration: Keep two systems in sync

Performance Improvements REST GIS web service >> JSON object >> Parse the JSON into individual records >> Generate XML for each record >> Process the XML records with Java ...
nr_aus's user avatar
  • 109
1 vote

Integration: Keep two systems in sync

If the systems support / allow it, I would be inclined to build a queuing table and use triggers, in the app or in the db, as applicable, to insert sync requests into the queuing table. You could then ...
Preacher's user avatar
  • 111
1 vote

Integration: Keep two systems in sync

Are you running flashback database? If you were you could run a process that would start just after the top of every hour. The process would look at each table as it was at the beginning of every hour ...
Gandolf989's user avatar
  • 1,520
1 vote

Date range query for past 24 hour in Mongo shell

db.collection.find( {$and: [ { "status.code":"DELIVERY_PENDING"}, {"status.createdDtm": {$lte: new Date().getTime()-(1*60*60*1000) }} ...
rohit chaurasiya's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible