Auto backup not working


#1

I tried to implement this autobackup script here:

http://wiki.dreamhost.com/index.php/Automatic_Backup

But when I do so I get the following error:

/bin/sh: /home/hopster/backups/domain.sh: /bin/bash
: bad interpreter: No such file or directory

The same thing happens for mysql.sh

As far as I can tell I’ve done everything correctly.

Is there something missing in the wiki that I should know about?

-Steve


#2

try changing the first line of the script from:
#!/bin/bash

to

#!/usr/bin/ksh

and run the script again. (You can run it from the command line so you don’t have to wait on cron by typing “ksh domain.sh”) Does that give an error, or what? Copy and paste any output in a post so I can see what’s going on.

-Matttail


#3

Thanks for the tip. I’ll try it tonight when I’m around a computer I can telnet from.

-Steve


#4

Still not working, I get a similar error.

[shekel]$ ksh domain.sh
ksh: line 1: domain.sh: not found


#5

Actually that is an entirley different error. The error you got this time around says that it couldn’t find the file domain.sh. Were you in the same directory as the shell script when you typed “ksh domain.sh” ?

I’m not sure if you’re familiar with shell sutff or not. If you’re not, you’ll need to be in the same directory as the shell script you’re trying to run. To move directories you use the command “cd”. So, if your script is in the backups directory, after you log into ssh, type “cd backups” Then try running that command.

-Matttail


#6

I’m not incredibly familar… I know some of the basics, but I didn’t realize you wanted me in the same directory… I’ll try that now.

: [No such file or directory]er/.snapshot/nightly.0/
tar: buggynews.com/\r: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors


#7

This is the string of commands I am trying to run…

#!/usr/bin/ksh
suffix=$(date %y%m%d)
cd /home/hopster/.snapshot/nightly.0/
tar -cf /home/hopster/backups/archives/buggynews.$suffix.tar buggynews.com/

Is my directory structure wrong in some way there? I followed the tutorial as far as I can see. Should it not be /home/hopster ??? I can cd to that string starting with hopster with no problem.


#8

Well, first off it looks to me like your directory structure is correct, but it’s saying that he direcoty buggynews.com is incorrect. Remember that the linux system is case SensItiVe, so make see if the direcoty is actually Buggynews.com or something.

Next, I’d reccomend that you put a ticket into support becuase bash is not compiled properly on your machine. That first error you got when you created the thred, it said that bash, the ‘command line interperter’ wasn’t there. It’s not an issue for this script, as it seems to work with ksh (a different command line interperter), but it could cause you and others on your machine headaches. You’re welcome to reference this thred when you put in the support ticket.

-Matttail


#9

Thanks for the info on bash. I’m at a loss with that directory, because it is all lower case like it should be.

I’ll put that ticket in.

-Steve