Gossamer Forum
Home : General : Perl Programming :

Backup using Perl script

Quote Reply
Backup using Perl script
I'm trying to run a script to backup some directories. I haven't fleshed it out because I've been getting some stupid errors for a while. Here's the Script:

#!/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`;



Here's the messages I get when I run it:


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 file

It runs file after the first error message, it even makes the data_full.tgz file, but then the next two messages pop up. Anyone have any idea what I'm doing wrong?
Quote Reply
Re: [trueneutral] Backup using Perl script In reply to
Hello Trueneutral,

Try :

system "cd /home/httpd; /bin/tar -cfz cgi-bin.tgz cgi-bin";


where I wish to tar and gzip the /home/httpd/cgi-bin directory using tar from /bin.

leaving out the v for verbose.

change to suit your paths and if it works then change static bits for $DATA type variables.

Hope this helps

cornball
Quote Reply
Re: [trueneutral] Backup using Perl script In reply to
What type of server are you on? I just found a cool script that uses Ensim's built in backup script to run it daily, and then FTP to another server... I think it will only work on Ensim though, due to the backup util it pipes into.

If you are on Ensim, please let me know, and I'll point you in the direction Wink

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!