Skip to content

Instantly share code, notes, and snippets.

View lalmazari's full-sized avatar

lal lalmazari

View GitHub Profile
@lalmazari
lalmazari / postgres_restore.sh
Created May 23, 2024 09:17
This Bash script automates the process of restoring databases from backup files using PostgreSQL's "pg_restore" utility.
#!/bin/bash
# Database connection information
DB_HOST=""
DB_PORT=""
DB_USER=""
DB_PASSWORD=""
# Array of databases to backup
DATABASES_TO_RESTORE=("DB_NAME1" "DB_NAME2")
@lalmazari
lalmazari / postgres_backup.sh
Created May 23, 2024 09:02
This Bash script automates the backup of PostgreSQL databases. It takes backups of specified databases and stores them in a timestamped directory.
#!/bin/bash
# Database connection information
DB_HOST=""
DB_PORT=""
DB_USER=""
DB_PASSWORD=""
# Get current timestamp
TIMESTAMP=$(date +"%d.%m.%Y")
@lalmazari
lalmazari / SMBbackup.sh
Created May 17, 2024 13:16
Automated Samba Backup Script - This script automates file backups to a Samba server.
#!/bin/bash
# Define variables
SMB_SERVER="your_samba_server_ip"
SMB_SHARE="your_samba_share_name"
USERNAME="your_samba_username"
PASSWORD="your_samba_password"
MOUNT_POINT="/mnt/smb_share"
SOURCE_FOLDER="/your/source/folder"
BACKUP_FOLDER="/backupfolder"