Skip to content
Snippets Groups Projects
Commit c2373ae9 authored by Andreas Kusalananda Kähäri's avatar Andreas Kusalananda Kähäri
Browse files

Fix sntax error and change name format for backup files.

parent 533f2ca0
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,8 @@ use POSIX;
local $| = 1;
my $timestamp = strftime( "%Y%m%d-%H%M%S", localtime() );
my %master_tables = ( 'attrib_type' => 1,
'external_db' => 1,
'misc_set' => 1,
......@@ -202,13 +204,11 @@ my %data;
if ( defined($dumppath) ) {
# Backup the table on file.
my $filename = sprintf( "%s/%s_%s-%s.sql",
$dumppath,
$dbname, $table,
strftime( "%Y%m%d-%H%M%S", localtime() )
);
my $filename = sprintf( "%s/%s.%s.%s.sql",
$dumppath, $dbname,
$table, $timestamp );
if ( -e $file_path ) {
if ( -e $filename ) {
die( sprintf( "File '%s' already exists.", $filename ) );
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment