Hello,
@Anonymous Monk
As I mentioned earlier I`ve tried both way in '' and "" and both don`t work.

@sundialsvc4
Thank for your nice opinion :).

For now i`ve fixed script a bit and translated it from polish descriptions and var names to english for easier reading for you :). Latest version of script:
#!/usr/bin/perl -w use strict; use warnings; #Variables my $fbbin = "/opt/firebird/bin/"; my $data = "/opt/databases/"; my $ext = "gdb"; #my $shared = "/opt/shared/"; my $tempdir = "/opt/backup/"; #my $destdir = "/home/mery/backup/complete/"; #my $usbdev = "/dev/sdc1/"; #my $localdir = "/mnt/storage/testy/"; #my $mailerr = "core-powiadomienia\@core.com.pl"; my $klient = "PanTester"; my $mailtopic = "Raport nocnej kopii zapasowej w firmie $klient"; use POSIX(); print POSIX::strftime('%Y-%m-%d-%H-%M-%S', localtime); #Create database filenames table @files my $type = $ext; my $dir = $data; $type = "*.$type"; print "looking for files with extension $type \n"; chdir ($dir); my @files = qx(ls $type 2>&1); foreach (@files) { print "Found database: $_\n"; } # This loop run external gbak backup command to create $_.gbk files as + output in $tempdir foreach (@files) { chdir ($fbbin); # print "Tworze kopie bazy $_ \n"; system("./gbak -user sysdba -password masterkey -BACKUP_DATABA +SE localhost\:$data$_ $tempdir`$_.gbk`") or die "Blad archiwizowania +bazy $_ \n"; # print "Gotowa kopia bazy $_ \n"; }
Output:
2012-02-28-22-23-33looking for files with extension *.gdb Found database: demo2.gdb Found database: demo.gdb Found database: SimpleMarketing2.gdb Found database: simplemarketing.gdb gbak: ERROR:requires both input and output filenames gbak:Exiting before completion due to errors sh: 1: demo2.gdb: not found sh: 2: .gbk: not found sh: 3: /opt/backup/: Permission denied gbak: ERROR:requires both input and output filenames gbak:Exiting before completion due to errors sh: 1: demo.gdb: not found sh: 2: .gbk: not found sh: 3: /opt/backup/: Permission denied gbak: ERROR:requires both input and output filenames gbak:Exiting before completion due to errors sh: 1: SimpleMarketing2.gdb: not found sh: 2: .gbk: not found sh: 3: /opt/backup/: Permission denied gbak: ERROR:requires both input and output filenames gbak:Exiting before completion due to errors sh: 1: simplemarketing.gdb: not found sh: 2: .gbk: not found sh: 3: /opt/backup/: Permission denied
/opt/backup is chmoded to 777 and owned by nobody.nogroup (it`s testing virtual machine so i`m not worried about security ;)) so i don`t understand why permission denied.

In reply to Re: Firebird databases backup script by Mery84
in thread Firebird databases backup script by Mery84

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.