Move related files into subdirs
This commit is contained in:
parent
2a20f18c78
commit
f543afed65
8 changed files with 99 additions and 0 deletions
|
|
@ -1,44 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
# backup_gitea_bin.pl
|
||||
# Author: Tracey Clark
|
||||
# Created: 2019-06-20
|
||||
# You must have a mail transport agent installed to run this script
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
### TEST CODE ###
|
||||
my $gitea_bin='/home/tracey/tmp/testbin';
|
||||
my $gitea_current_version='1';
|
||||
my %binary_file = (
|
||||
input => $gitea_bin,
|
||||
version => $gitea_current_version,
|
||||
);
|
||||
my ( %opts ) = %binary_file;
|
||||
my $input = $opts{input};
|
||||
my $version = $opts{version};
|
||||
my $gitea_bin_backup = '/home/tracey/tmp/testbin.' . $gitea_current_version . '.bz2';
|
||||
|
||||
### TEST CODE ###
|
||||
# my ( %opts ) = %{shift()};
|
||||
# my $input = $opts{input};
|
||||
# my $version = $opts{version};
|
||||
printf("Backing up the current binary\n");
|
||||
printf("Input in backup_bin script is $input\n and version is $version\n");
|
||||
|
||||
|
||||
# my $gitea_bin_backup = '/home/gitea/bin/gitea.' . $gitea_current_version . '.bz2';
|
||||
printf("Gitea bin backup will be $gitea_bin_backup\n");
|
||||
# Do this with a system call to make a compressed copy of the current binary
|
||||
# bzip2 -k file.txt
|
||||
# my $status = system("vi", "fred.txt");
|
||||
# if (($status >>=8) != 0) {
|
||||
# die "Failed to run vi";
|
||||
# }
|
||||
|
||||
# HEREHERE how to specify output file??
|
||||
my $bzip_status = system("/bin/bzip2 -k $input");
|
||||
if (($bzip_status >>=8) != 0) {
|
||||
die "Failed to run bzip2";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue