Most of these scripts should work on all Unix distros and Mac OS X. It will be stated on the file if it doesn't.
This is for copying your public key to a remote server. Saves you time typing password over and over again.
Update: If you are using homebrew, you do not need to download this. Simply install homebrew and do:
brew install ssh-copy-id
I used this at a time when homebrew was not popular. In case there are still helpful scripts which are not ideal as homebrew formulas, I will add them up here.
Usage:
cd ~/.ssh/ && ssh-copy-id -i id_rsa.pub user@remoteserver
- copy and modify linux/backup_mysqldb.sh
- ssh to remote server
- copy contents of file to
~/scripts/backups.sh
- give proper write permissions to make script executable.
chmod a+x ~/scripts/backups.sh
- crontab -e
- Add this if you want to backup database per hour:
0 0 * * * ~/scripts/backups.sh
On the server where you store backups, make sure to create the directories (e.g., mkdir -p ~/backups/database
).
- copy and modify linux/backup_postgresqldb.sh
- ssh to remote server
- copy contents of file to
~/scripts/backups.sh
andchmod a+x ~/scripts/backups.sh
- give proper write permissions to make script executable
chmod a+x ~/scripts/backups.sh
- update the .pgpass file on your home directory. This is needed to make sure you can backup the database without entering a password.
hostname:port:database:username:password
-
crontab -e
- Add this if you want to backup database per hour:
0 0 * * * ~/scripts/backups.sh