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 ...
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))
}
})
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 ...
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-...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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
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 ...
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
...
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, ...
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 ...
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 ...
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 ...
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) }}
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
cron × 35mysql × 14
postgresql × 13
oracle × 4
linux × 4
backup × 3
mysqldump × 3
scripting × 3
replication × 2
mongodb × 2
php × 2
postgresql-9.3 × 2
ubuntu × 2
jobs × 2
data-synchronization × 2
my.cnf × 2
password × 2
scheduled-tasks × 2
pg-cron × 2
sql-server × 1
performance × 1
mariadb × 1
stored-procedures × 1
oracle-11g-r2 × 1
security × 1