Is it possible to create a .sh shell or .command file with a configuration file?
I need to backup websites via Terminal and be able to put some data to configuration files, and have the shell execute it.
For example, the username, password, ssh id, et cetera.
#!/bin/bash
ssh admin@host.com "tar cjvf webfilesbackup-date-`date +%Y%m%d`.tar.bz2 public_html/"
ssh admin@host.com "mysqldump -u user_admin -ppass database_1 > databasebackup-`date +%Y%m%d`-db.sql"
scp admin@host.com:webfilesbackup-date-`date +%Y%m%d`.tar.bz2 ~/backup/
scp admin@host.com:databasebackup-`date +%Y%m%d`-db.sql ~/backup/
ssh admin@host.com "rm -f webfilesbackup-date-`date +%Y%m%d`.tar.bz2"
ssh admin@host.com "rm -f databasebackup-`date +%Y%m%d`-db.sql"
