Move related files into subdirs
This commit is contained in:
parent
2a20f18c78
commit
f543afed65
8 changed files with 99 additions and 0 deletions
21
nextcloud/draft_nextcloud_mod_install.md
Normal file
21
nextcloud/draft_nextcloud_mod_install.md
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
# Script for upgrading Nextcloud or insalling missing modules
|
||||||
|
|
||||||
|
perl
|
||||||
|
|
||||||
|
```perl
|
||||||
|
# pseudocode
|
||||||
|
# example mod name php8.0-zip
|
||||||
|
my $php_ver = shift; # format php8.0
|
||||||
|
|
||||||
|
for my $module (@modules)
|
||||||
|
my $full_mod_name = $php_ver . "-" . $module
|
||||||
|
push @install_list ($full_mod_name)
|
||||||
|
my $install_cmd = "apt install " . @install_list # will this put commas in?
|
||||||
|
system $install_cmd
|
||||||
|
system 'apachectl restart'
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
apt install php8.0-mbstring php8.0-curl
|
||||||
|
```
|
||||||
54
nextcloud/install_nextcloud_php_mods.pl
Executable file
54
nextcloud/install_nextcloud_php_mods.pl
Executable file
|
|
@ -0,0 +1,54 @@
|
||||||
|
#!/bin/env perl
|
||||||
|
# ABSTRACT: Make sure all modules required by Nextcloud are installed for a PHP versoin
|
||||||
|
# PODNAME: install_nextcloud_php_mods
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use utf8;
|
||||||
|
use warnings qw( all );
|
||||||
|
use Modern::Perl;
|
||||||
|
use File::Basename;
|
||||||
|
|
||||||
|
use FindBin;
|
||||||
|
use Cwd qw/realpath/;
|
||||||
|
use lib "$FindBin::Bin/../lib";
|
||||||
|
|
||||||
|
use Getopt::Long;
|
||||||
|
use Pod::Usage;
|
||||||
|
|
||||||
|
# VERSION 0.1
|
||||||
|
|
||||||
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
install_nextcloud_php_mods.pl phpversion
|
||||||
|
|
||||||
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
|
Attempts to install a list of modules needed by Nextcloud for the given PHP version. PHP version is in the form of php8.0
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
GetOptions(
|
||||||
|
q(help) => \my $help,
|
||||||
|
q(verbose) => \my $verbose,
|
||||||
|
) or pod2usage(q(-verbose) => 1);
|
||||||
|
pod2usage(q(-verbose) => 1) if $help;
|
||||||
|
|
||||||
|
die "PHP versoin required\nUsage: $0 filename(s) \n" unless ( @ARGV );
|
||||||
|
# \N is null
|
||||||
|
my $php_version = @ARGV;
|
||||||
|
|
||||||
|
# Standard defense against hung script
|
||||||
|
my ($timeout, $size, $buffer) = (5, 0, undef);
|
||||||
|
my $nread = undef;
|
||||||
|
eval {
|
||||||
|
local $SIG{ALRM} = sub { die "alarm\n" }; #\n required
|
||||||
|
alarm $timeout;
|
||||||
|
$nread = sysread STDIN, $buffer, $size;
|
||||||
|
alarm 0;
|
||||||
|
};
|
||||||
|
if ($@) {
|
||||||
|
print "Script timed out, check the command\n";
|
||||||
|
die "Script timed out" unless $@ eq "alarm\n"; # propagate unexpected errors
|
||||||
|
}
|
||||||
|
|
||||||
|
# Script goes here
|
||||||
24
rsync_restore.txt
Normal file
24
rsync_restore.txt
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
# rsync restore
|
||||||
|
|
||||||
|
from $backup_dir_mount/tracey_home to original locations in /home/tracey
|
||||||
|
|
||||||
|
backup_dir_mount='/data/LinuxBack'
|
||||||
|
rsync -aAXv --delete --exclude="lost+found" "$backup_dir_mount/tracey_home" /home/tracey
|
||||||
|
|
||||||
|
test with just one directory to make sure it goes to right place
|
||||||
|
|
||||||
|
backup_dir_mount='/data/LinuxBack'
|
||||||
|
rsync -aAXv --exclude="lost+found" "$backup_dir_mount/tracey_home/Applications" /home/tracey/Applications
|
||||||
|
|
||||||
|
-a - archive mode.
|
||||||
|
-A - preserve Access Control List.
|
||||||
|
-X - preserve extended attributes.
|
||||||
|
|
||||||
|
backup_dir_mount='/data/LinuxBack'
|
||||||
|
sudo rsync -aAXv --exclude="lost+found" "$backup_dir_mount/var" /var/lib/libvirt/images
|
||||||
|
|
||||||
|
rsync -aAXv --exclude="lost+found" "$backup_dir_mount/tracey_home/Applications" /home/tracey/Applications
|
||||||
|
|
||||||
|
sudo rsync -aAXv --exclude="lost+found" "$backup_dir_mount/var/images" /var/lib/libvirt/
|
||||||
|
|
||||||
|
sudo rsync -aAXv --exclude="lost+found" "$backup_dir_mount/var/qemu" /var/lib/libvirt/
|
||||||
Loading…
Add table
Add a link
Reference in a new issue