start ver

This commit is contained in:
2017-09-17 12:07:11 +02:00
parent cb5807a7b2
commit ec31e8f567

28
SetupNewComp.pl Executable file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/perl
use warnings;
use strict;
#use DBI;
#use Passwd::Linux qw(modpwinfo setpwinfo rmpwnam mgetpwnam);
use Data::Dumper qw(Dumper);
sub getTimeStamp { # parm [ts] => timestamp for filename; log => timestamp for log
my $format = "%04d%02d%02d%02d%02d%02d";
my ($p1) = @_;
if (defined $p1 and $p1 eq "log") {
$format = "%04d%02d%02d %02d:%02d:%02d";
}
if (defined $p1 and $p1 eq "db_ts") {
$format = "%04d-%02d-%02d %02d:%02d:%02d";
}
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
my $timestamp = sprintf ( $format, $year+1900,$mon+1,$mday,$hour,$min,$sec);
return $timestamp;
}
print getTimeStamp("log") . " - pid $$ >> Execution started.\n";
my @info = getpwnam('alex');
print Dumper \@info;
print getTimeStamp("log") . " - pid $$ >> Execution ended.\n";
exit;