Uname: Linux 50-6-4-53.bluehost.com 5.14.0-611.41.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Mar 19 03:50:11 EDT 2026 x86_64
User: 1011 (dccreditrepairto)
Group: 1010 (dccreditrepairto)
Disabled functions: NONE
Safe mode: On[ PHPinfo ]
//scripts      ( Reset | Go to )
File Name: precpbackup
#!/usr/bin/perl

use strict;

my $v = 1 if ($ARGV[0] =~ /^-(|-)(v|verbose)$/i);
my $location = "/backup/cpbackup/sbr";

if ( !-d $location ) {
    print "SBnR folder not found.\n" if ( $v );;
    exit 0;
}

my %mounts = ();
foreach my $mount ( `cat /proc/mounts` ) {
    next if ($mount !~ m/^archivemount\s+(\S+)\s/);
    $mounts{$1} = 1;
}
exit 0 and print "No SBnR mounts found.\n" if ( %mounts == () && $v );

my $user = '';
opendir(SBR, $location);
foreach my $dir ( readdir SBR ) {
    next if ( $dir =~ m/^\./ );
    $user = $1 if ($dir =~ m/^(\w+)\./);
    print "Checking $user in $location/$dir/$user\n" if ( $v );
    if ( $mounts{"$location/$dir/$user/homedir"} ) {
        print "$dir/$user/homedir found, unmounting..." if ( $v );
        system("umount -l $location/$dir/$user/homedir\n") == 0 or die "Can't unmount $location/$dir/$user/homedir\n";
        print "done.\n" if ( $v );
    }
    if ( $mounts{"$location/$dir"} ) {
        print "$dir found, unmounting..." if ( $v );
        system("umount -l $location/$dir\n") == 0 or die "Can't unmount $location/$dir/$user/homedir\n";
        print "done.\n" if ( $v );
    }
}
closedir SBR;

All system for education purposes only. For more tools: Telegram @jackleet

Mr.X Private Shell

Logo
-
New File | New Folder
Command
SQL