Pretty much as the subject line says, I just wrote a shell script that goes like this:
Code: Select all
#!/bin/sh
# What to backup.
backup_files="/home /var/www /etc"
# Where to backup to.
dest="/home/storage/transmission
# Create archive filename.
day=$(date +%A)
hostname=$(hostname -s)
archive_file="$hostname-$day.tgz"
# Backup the files using tar.
tar czf $dest/$archive_file $backup_files
I chmod'ed it to 755, and tried to run it, but I got the following:
Code: Select all
bash: .backup.sh: bin/sh: bad interpreter: No such file or directory
I may not be the most advanced shell scripter in the world, but I've used similar scripts on a variety of linux systems, and never seen that before. I googled it, and the usual cause seems to be people writing the script in Windows, then importing it into wherever they're going to use it, but I wrote it while ssh'ed into my B3 (2TB wifi), in vi.
Any ideas why I'm seeing this?