Sync PostgreSQL users to SFTP via CSV daily
Recipe ToolsMarketingDatabaseData ParserUtilitiesFile Transfer
What it does
Every day at 6 PM, this automation queries the PostgreSQL users table and exports the rows to a CSV file. The file is uploaded to the SFTP server and emailed so the team has a current backup.
Who it's for
Data and analytics teams who need a daily PostgreSQL user export without manual downloads.
How teams use this
Back up users daily without manual export
Run the PostgreSQL query and CSV export on schedule so the team always has a current backup on the SFTP server. No one has to remember to download it.
Filter users by status before export
Add a condition to the PostgreSQL query so only active users are included in the CSV. This keeps the export focused and reduces file size.
Archive exports to a second location
Include a second upload step to send the CSV to an archive folder on the SFTP server with a timestamp. This creates a version history without extra manual work.
Shift the schedule to match business hours
Change the daily trigger time from 6 PM to 8 AM so the export is ready when the team starts work. Only the clock schedule changes.
How it works
- Run every day at 6 PM. This automation starts on a daily schedule at 6 PM to pull the latest user data from PostgreSQL.
- Query the users table. Select all rows from the ilm.users table in PostgreSQL so the export includes the current user records.
- Compose the CSV file. Convert the PostgreSQL rows into a CSV format that is ready to upload and share with the team.
- Upload file to SFTP server. Send the CSV file to the SFTP server so it is stored and accessible for downstream processes and backups.
- Email the backup notification. Notify the team via email that the daily user export is ready on the SFTP server for download.