hi all,
i am getting this error in my perl code. I am not a programmer and need to have this error sorted out. The script's job is to take up a weekly backup and print the revision no. into a log file. The error thrown at the console is
print() on closed filehandle LOG at /home/shann/weekbkp.pl line 20.
The code is as follows: I have highlighted the line 20.
i am getting this error in my perl code. I am not a programmer and need to have this error sorted out. The script's job is to take up a weekly backup and print the revision no. into a log file. The error thrown at the console is
print() on closed filehandle LOG at /home/shann/weekbkp.pl line 20.
The code is as follows: I have highlighted the line 20.
#!/usr/bin/perl -w
#
# Perform a weekly backup of a Subversion repository,
# logging the most-recently-backed-up revision so an
# incremental script can be run other days.
my $svn_repos = '/cvs/satrang/software';
my $backups_dir = '/home/svnbkp';
my $next_backup_file = 'weekly-full-backup-svn.' . `date +%Y%m%d`;
my $youngest = `svnlook youngest $svn_repos`;
chomp $youngest;
print "Backing up to revision $youngest\n";
`svnadmin dump $svn_repos > $backups_dir/$next_backup_file`;
print "Compressing dump file...\n";
print `gzip -9 $backups_dir/$next_backup_file`;
open(LOG, '>$backups_dir/last_backed_up');
[COLOR=red yellow]print LOG '$youngest';[/color]
close LOG;