I'm experiencing to write a perl script for to make backup with afio under perl .
But a have some problem when try to execute the system command with the " @_ " this seem to be not the right way for exec this system command "i'm not sure" .
but in past time i'm used this kind of syntax for another script that make the quota for all users in a directory on the same way.
the backup scrpt is as follow:
#!/usr/bin/perl -w
#use IO::Socket; use IPC::Open2; use Term::ANSIColor; use POSIX ":sys_wait_h";
my $status; #$pid = fork; #$begin = 1 if ( !$begin ); #$end = $i if ( !$end);
#$FULLSYSTEM_SOURCE_DIR = "/home/webhosting/utenti/"; $MOUNT_DIR = "/mnt/test"; $BACKUP_FILE = "Testbackup.cpio"; $FULL_LOG_FILE = "Testlog.log";
$filename = "/home/webhosting/utenti/stats.txt";
@_=`ls -l`; #Read the direcory content while ($_ = shift @_) { @strarr = split ' '; open(LOG, ">> $filename") || die "cannot open file"; print LOG "$strarr[8]\n"; #and write the filenames on a file close (LOG); }
open (LOG1, "< /home/webhosting/utenti/stats.txt") || die "cannot open file with LOG1";
@log1=(<LOG1>);
for ($i=1;$i<=((@log1)/4);$i++){ #my dir is too big so i devide the content in parts more little
open (LOG2, ">> /home/webhosting/utenti/statswork.txt") || die "cannot open file with LOG1";
print LOG2 "$log1[$i]"; #and write this part on a new file
open (LOG3, "< /home/webhosting/utenti/statswork.txt") || die "cannot open file with LOG1"; #so... now the trouble .
#this is the system command that i experience to exec but when i exec the script i receive this : sh: -print: command not found
and the script terminate .
So how can i accomplish this trouble?
@_= `/usr/bin/find $log1[$i] -print -depth -mount -xdev | /usr/bin/afio -oulvAZ/ -T3k -s 2000m -L$MOUNT_DIR/$FULL_LOG_FILE $MOUNT_DIR/$BACKUP_FILE`; /
close (LOG3); close (LOG2); close (LOG1); }
Pleeese help I need backup . Thanks in advance and sorry for my ugly english .
Saffioti Goffredo .
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]