Web Hosting Talk







View Full Version : Backup system question


dico
09-18-2001, 10:36 PM
Hi there,

I am relatively new to all this, so please excuse my ignorance.

I am trying to implement the backup system that people have been discussing in this forum.

Here is what I have (a limited backup):

#!/usr/bin/perl

#FTP Server Info HERE
$ftps = "mp.ip.address.here";
$ftpu = "username";
$ftpp = "password";
$serv = "anythinghere";

system("/bin/tar cfp - /home/sites/site60 | gzip |
/usr/local/bin/ftpbackup -h $ftps -u
$ftpu -p $ftpp -b $serv-home.tar.gz");

When I run the above by typing . backup.pl I get the following:

[root ftpbackup-2.1]# . backup.pl
sh: =: command not found
sh: =: command not found
sh: =: command not found
sh: =: command not found
sh: syntax error near unexpected token `$serv-home.tar.gz")'
sh: backup.pl: line 11: `$ftpu -p $ftpp -b $serv-home.tar.gz");'
[root ftpbackup-2.1]#

I'd appreciate any help.

Thanks in advance,

-dr

madsere
09-19-2001, 07:10 PM
You're trying to execute a perl script using a shell interpreter.

Change

. command

to

./command

and you'll be ok

dico
09-19-2001, 07:40 PM
Thanks... that worked fine...

one more little question:

When I run it now it says:

/bin/tar: Removing leading '/' from member names


But in the end the file it transfered. Should I be concerned?

Thanks,

-dr

peteb
09-19-2001, 11:45 PM
No worries!

tar is removing the leading / to make the absolute path (/home/sites/xyz/) into a relative path (home/sites/xyz). When you untar the backup file, it will unpack everything under your current directory. If it still had the leading /, then it would always unpack everything directly into /home/sites/xyz - a potential disaster if you only wanted to recover a file or two.

Cheers!
Pete.