I am trying to get rid of the Removing leading messages from a cron that runs a backup job with tar. The emails still have these messages, and I'm using cronic to only send emails when there are errors.:ERROR OUTPUT:/bin/tar: Removing leading `/' from member names/bin/tar: Removing leading `/' from hard link targets/bin/tar: Removing leading `/' from member namesI edited the tar -czf to include the -C option that I got from this thread as such. my($tarcmd) = $tar -czf $backupname -C / $args $backup;Where can I remove the leading slash as mentioned in Orville Bennet's blog post?Perhaps somewhere in this section of the script?            # drobo=/path/to/droboif( /^\s*drobo\s*=\s*(.*)$/ ) {$drobopath=$1;}            # tarargs=global tar argumentselsif( /^\s*tarargs\s*=\s*(.*)$/ ) {$tarargs=$1;}            # backup [condition] =/path/for/backup [tar args]elsif( /^\s*backup\s*(\[[^\]]*\])?\s*=\s*(.*)$/ ) {push(@backup,$2);if( $1 ) {    $condition{$2} = $1;Here is the entire script:#!/usr/bin/perl -Wuse POSIX;# Global variables# Host name will be used as name of directory for backups on drobomy($hostname)=`/bin/hostname`;chomp($hostname);my($configfile)=/etc/drobo-backup.conf;my($tar)=/bin/tar;        # Path to tar utilitymy($mkdir)=/bin/mkdir;    # Path to mkdir utilitymy($verbose)=0;my($testmode)=0;sub Usage {    print Usage: drobo-backup [-v] [-c configfile]\n;    print    -v : verbose mode;    print    -c : specify configuration file (default $configfile);    print    -n : printd but don't execute commands (for testing config);    exit 1;}# Subroutine to back up one directory to drobosub do_backup {    my($drobo,$args,$backup,$cond) = @_;# The backup arg may include per-backup tar args.  Strip off these# and quotes to get at the filename    my($backuppath)=$backup;# If quoted, remove quotes for naming.  Otherwise it is required not# not to have embedded blanks so that per-backup tar arguments may follow.    if( $backuppath =~ /^([^]*)/ ) { # double quotes    $backuppath = $1;    }    elsif( $backuppath =~ /^'([^']*)'/ ) { # single quotes    $backuppath = $1;    }    elsif( $backuppath =~ /^(\S*)/ ) { # otherwise no blanks in path    $backuppath = $1;    }    if( -d $backuppath || -f $backuppath ) { # check it is a valid dir or file    my($drobodir) = $drobo/$hostname;    # make sure the drobo subdirectory for this host exists    my($mkdircmd) = $mkdir $drobodir;    if( $verbose ) {        print $mkdircmd\n;    }    if( ! ($testmode || -d $drobodir) ) {        system($mkdircmd);    }    # if it did not work, bail.    if( ! ($testmode || -d $drobodir) ) {        print Failed to create destination dir $drobodir\n;        exit 1;    }# construct tarfile name, e.g. usr-local.tgz    my($backupfilestem) = $backuppath;                # Sanitize the tarfile name    while($backupfilestem =~ s,^/,,) { next; } # remove any leading slash(es)    while($backupfilestem =~ s,/$,,) { next; } # remove any trailing slash(es)    $backupfilestem =~ s,/,-,g; # all internal slashes become hyphens    $backupfilestem =~ s/[^-\.\w]/X/g;# all remaining non-word chars exc . become X    my($backupname)=$drobodir/$backupfilestem-new.tgz;    my($backuprename) = $drobodir/$backupfilestem.tgz;    my($tarcmd) = $tar -czf $backupname -C / $args $backup;    if( $cond ) {        $cond =~ s/^\[//;   # remove the [ ] around condition        $cond =~ s/\]$//;        $cond =~ s/BKPATH/$backuppath/g; # convenience substitutions        $cond =~ s/TARFILE/$backuprename/g;        $cond =~ s/TARDIR/$drobodir/g;    }    if( $cond && WEXITSTATUS(system(test $cond)) != 0 ) {        if( $verbose ) {        print Condition [$cond] tests false\n;        print No backup of $backuppath\n;        }    }    else {        if( $verbose ) {        if( $cond ) {            print Condition [$cond] tests true\n;        }        print $tarcmd\n;        }    # tar returns 0 for success, 1 for warnings such as file changed while    # being copied.  So we take either as meaning success.  Rename foo-new.tgz    # to the (usually existing) foo.tgz.  N.B. system() returns status<<8.        if( !$testmode ) {        if( WEXITSTATUS(system($tarcmd)) >= 2 ) {            print \nBackup of $backuppath FAILED\n\n;            # to avoid bad backup being renamed to good in second try, call it bad            $backuprename = $drobodir/$backupfilestem-FAILED.tgz;        }        if( rename($backupname,$backuprename) ) {            print Backed up $backuppath to $backuprename\n;        }        else {            print Failed to rename $backupname to $backuprename: $!\n;        }        }    }    }    else {    print $backuppath is not a directory or file\n;    }}# default arguments to use on every backupmy($tarargs)=--atime-preserve --one-file-system;# set default drobopath according to dsm (lc) or cis (rh) networkmy($drobopath)=/path; #if($hostname =~ /\.our\.domain\.edu/) {    $drobopath=/path; #}# Process command line argumentswhile(@ARGV) {    if( $ARGV[0] eq -c ) {    # -c configfile    shift (@ARGV);    if(@ARGV) {        $configfile = $ARGV[0];    }    else {        Usage();    }    }    elsif( $ARGV[0] eq -v ) { # -v (verbose mode)    ++$verbose;    }    elsif( $ARGV[0] eq -n ) { # -n (no-exec mode)    $testmode = 1;    }    else {          # unrecognized argument    Usage();    }    shift (@ARGV);}open(CONFIGFILE,$configfile) || die(Cannot open configfile $configfile: $!);if($verbose) {    print Reading configfile $configfile\n;}my(@backup);my(%condition);my($configline) = 0;foreach (<CONFIGFILE>) {    $configline++;    if( /^\s*#/ || /^\s*$/ ) {  # skip blank & comment lines (first nonblank is #)    next;    }                # drobo=/path/to/drobo    if( /^\s*drobo\s*=\s*(.*)$/ ) {    $drobopath=$1;    }                # tarargs=global tar arguments    elsif( /^\s*tarargs\s*=\s*(.*)$/ ) {    $tarargs=$1;    }                # backup [condition] =/path/for/backup [tar args]    elsif( /^\s*backup\s*(\[[^\]]*\])?\s*=\s*(.*)$/ ) {    push(@backup,$2);    if( $1 ) {        $condition{$2} = $1;    }    }    else {    print Unknown config directive at line $configline in $configfile:\n;    print;    exit 1;    }}close(CONFIGFILE);my($path);foreach $path (@backup) {    do_backup($drobopath,$tarargs,$path,$condition{$path});}# For unknown reason, rename of some files often fails.  Try again here.foreach $tarfile ( glob($drobopath/$hostname/*-new.tgz) ) {    $rename_name = $tarfile;    $rename_name =~ s/-new\.tgz$/.tgz/;    if( rename($tarfile,$rename_name) ) {    print Second try renamed $tarfile to $rename_name\n;    }}
still getting Removing leading `/' from member names with tar -C option from cron email
cron;tar