postgres query with output
This commit is contained in:
parent
6d3eb6b486
commit
3f8fbf093c
|
@ -140,6 +140,7 @@ function expire_pleroma_posts {
|
|||
|
||||
pleroma_expire_script=/etc/cron.daily/pleroma-expire
|
||||
echo '#!/bin/bash' > $pleroma_expire_script
|
||||
echo 'cd /etc/postgresql' >> $pleroma_expire_script
|
||||
echo "find /etc/pleroma/uploads/* -mtime +${expire_days_files} -exec rm -rf {} +" >> $pleroma_expire_script
|
||||
echo "$pleroma_expire_posts_script 2> /dev/null" >> $pleroma_expire_script
|
||||
chmod +x $pleroma_expire_script
|
||||
|
|
|
@ -145,10 +145,7 @@ function run_query_postgresql_with_output {
|
|||
database_name=$1
|
||||
database_query=$2
|
||||
cd /etc/postgresql
|
||||
output=$(sudo -u postgres psql -d $database_name -c << EOF
|
||||
$database_query
|
||||
EOF
|
||||
)
|
||||
output=$(sudo -u postgres psql -d $database_name -c "$database_query")
|
||||
echo "$output"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue