Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I'm trying to write a backup script to backup a couple directories. This is what I have so far, it's not fleshed out because I've been getting errors:
#!/usr/bin/perl
$DATA = "/root/. /usr/local/.";
$CONFIG="/etc/. /var/lib/.";system `tar cvfz data_full.tgz $DATA`;
system `tar cvfz config_full.tgz" $CONFIG`;These are the errors I recieve after I run the script:
tar: Removing leading `/' from member names
sh: -c: line 1: unexpected EOF while looking for matching `"'
sh: -c: line 2: syntax error: unexpected end of fileEven with these errors it does create the data_full.tgz file, but before it finishes it outputs the last two errors to the screen.
Can anyone tell me what I'm doing wrong here? Thanks

Hi-
I think I see the two problems. Right before the $CONFIG there is a double quote, remove it. The other thing is when you define your variables, get rid of the trailing slash, ie.
$CONFIG="/etc /var/lib";
That should get rid of the errors.-Mark

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |