✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ server.blackpussy.asia ​🇻​♯➤ 5.14.0-611.20.1.el9_7.x86_64 #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 163.245.207.76 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.243
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗞 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ mail,mb_send_mail
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /usr/share/doc/perl-IPC-System-Simple/examples//rsync-backup.pl
#!/usr/bin/perl -w

# The following example code uses IPC::System::Simple to mount
# a /mnt/backup directory, run an rsync command, and then unmount
# the directory again.

use strict;
use IPC::System::Simple qw(run capture);
use POSIX qw(nice strftime);
use Fatal qw(open close nice);
use constant NICE_VALUE => 10;

die "Must be root" if $> != 0;

nice(NICE_VALUE);

my $mounted = 0;
my $today   = strftime('%Y-%m-%d',localtime);

# The capture() from IPC::System::Simple either works, or dies.
my $machine_name = capture("hostname");

open(my $mtab_fh, '<', '/etc/mtab');

while (<$mtab_fh>) {
	if (m{/mnt/backup}) {
		$mounted = 1;
		last;
	}
}

close($mtab_fh);

if (not $mounted) { 
	# Our run() from IPC::System::Simple either works, or dies.
	run(qw(/bin/mount /mnt/backup));
}

my $last_backup = '';

foreach my $dir ( glob("/mnt/backup/$machine_name/*") ) {

	next if not -d $dir;

	# 'gt' is correct here, since we're delaing with YYYY-MM-DD
	if ($dir gt $last_backup) {
		$last_backup = $dir;
	}
}

die "Cannot find last backup" unless $last_backup;

#  0 - Successful backup
# 24 - Files disappeared during backup.  This is expected on
#      an active filesystem, and not considered an error.

run([0,24],
	qw(/usr/bin/rsync -aH --exclude-from=/etc/rsync-ignore), 
	"--link-dest=$last_backup","/",
	"/mnt/backup/teddybear/$today",
);

# Unmount our filesystem if we found it unmounted to begin with.
# Again, run() either succeeds, or dies.

if (not $mounted) {
	run(qw(/bin/umount /mnt/backup));
}

Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]

Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
17 Jan 2026 3.14 PM
root / root
0755
rsync-backup.pl
1.478 KB
23 Jan 2020 8.00 PM
root / root
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF