Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Useless use of a constant

Status
Not open for further replies.

massoo

Technical User
Aug 18, 2003
7
IN
hi all,
i am getting these errors while backing up an subversion repository. the full trace of the errors are :

./daybkp.pl
Useless use of a constant in void context at ./daybkp.pl line 26.
Name "main::backups_dir" used only once: possible typo at ./daybkp.pl line 6.
Name "main::svnadmin_cmd" used only once: possible typo at ./daybkp.pl line 23.
Name "main::next_backup_file" used only once: possible typo at ./daybkp.pl line 7.
Name "main::svn_repos" used only once: possible typo at ./daybkp.pl line 5.
readline() on closed filehandle IN at ./daybkp.pl line 9.
Use of uninitialized value in scalar chomp at ./daybkp.pl line 10.
Use of uninitialized value in string eq at ./daybkp.pl line 14.
Use of uninitialized value in addition (+) at ./daybkp.pl line 20.
Backing up revisions 1 to svnlook youngest $svn_repos...
Compressing dump file...
print() on closed filehandle LOG at ./daybkp.pl line 30.
gzip -9 $backups_dir/$next_backup_file

the daybkp.pl file is as follows:

#!/usr/bin/perl -w
# # Perform a daily backup of a Subversion repository,
# using the previous most-recently-backed-up revision
# to create just an incremental dump.
$svn_repos = '/cvs/satrang/software';
$backups_dir = '/home/svnbkp';
$next_backup_file = 'daily-incremental-backup-svn.' . 'date +%Y%m%d' ;
open(IN, '$backups_dir/last_backed_up');
$previous_youngest = <IN>;
chomp $previous_youngest;
close IN;
$youngest = 'svnlook youngest $svn_repos' ;
chomp $youngest;
if($youngest eq $previous_youngest) {
print "No new revisions to back up.\n";
exit 0;
}
# We need to backup from the last backed up revision
# to the latest (youngest) revision in the repository
$first_rev = $previous_youngest + 1;
$last_rev = $youngest;
print "Backing up revisions $first_rev to $last_rev...\n";
$svnadmin_cmd = 'svnadmin dump --incremental ' .
'--revision $first_rev:$last_rev ' .
'$svn_repos > $backups_dir/$next_backup_file';
'$svnadmin_cmd' ;
print "Compressing dump file...\n";
print 'gzip -9 $backups_dir/$next_backup_file' ;
open(LOG, '>$backups_dir/last_backed_up');
print LOG $last_rev;
close LOG;

how to solve this and where am i going wrong ?

regards
shann
 
The line before this line:

'$svnadmin_cmd' ;

is this line:

'$svn_repos > $backups_dir/$next_backup_file';


it has a semi-colon on the end, maybe it should be a dot.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top