Maecenas sit amet purus eget ipsum elementum venenatis. Aenean maximus urna magna elementum venenatis, quis rutrum mi semper non purus eget ipsum elementum venenatis.
Purus eget ipsum elementum venenatis. Aenean maximus urna magna elementum venenatis, quis rutrum mi semper non purus eget ipsum elementum venenatis.
MEGAcmd is MEGA’s official CLI, and on Gentoo it’s easiest to build from source. The MEGA SDK snapshot used here needs a small ffmpeg compile fix (the same patch used in the Arch AUR). The steps below pull the exact sources, apply the patch, then build and install.
This is a simple, no‑frills way to take daily PostgreSQL backups with pg_dump and cron. The script writes timestamped dumps and keeps only the last 7 days.
1. Create a backup script
Create the script file:
vi /path/to/backup_script.sh
Add the content below. Swap the database credentials and backup directory.
#!/bin/bash
# Database credentialsDB_NAME="your_database_name"DB_USER="your_database_user"DB_PASSWORD="your_database_password"# Backup directoryBACKUP_DIR="/path/to/backup/directory"mkdir -p $BACKUP_DIR# Date format for backup fileDATE=$(date +%Y-%m-%d_%H-%M-%S)# Backup file nameBACKUP_FILE="$BACKUP_DIR/${DB_NAME}_$DATE.sql"# Export password to avoid promptexportPGPASSWORD=$DB_PASSWORD# Perform the backuppg_dump -U $DB_USER -d $DB_NAME -F c -f $BACKUP_FILE# Unset the passwordunset PGPASSWORD
# Optional: Delete backups older than 7 daysfind $BACKUP_DIR -type f -name "*.sql" -mtime +7 -exec rm {}\;echo"Backup completed successfully at $DATE"