perl <<'EOF'
use strict;
use warnings;
my $option = 'option_placeholder';
my $user = 'user_placeholder';
if ( ! -e "/proc/user_beancounters" ) {
    if ( ! -f "/var/cpanel/users/$user" ) {
        print "[!] The user $user does not exist on this server.\n";
        exit;
    }
}

if ( -f '/etc/init.d/cdp-agent' ) {
    print "\n[!] Unable to skip backups. Server is configured to use cdp.\n";
    exit();
}

if ( qx(/sbin/chkconfig --list datacycle 2>/dev/null) =~ /:on/ ) {
    print "\n[!] Unable to skip backups. Server is configured to use datacycle.\n";
    exit();
}

if ( $option eq 'vps' ) {
    system("touch /.skip_next_hg_backup");
    print "\n[+] The next backup for this VPS will be skipped.\n";
}

if ( $option eq 'perm' ) {
    system("touch /home/$user/.skip_hg_backup");
    print "\n[+] Home directory backups have been disabled for $user.\n";
}

if ( $option eq 'next' ) {
    system("touch /home/$user/.skip_next_hg_backup");
    system("touch /home/$user/.skip_next_db_backup");
    if ( -f '/root/bin/backuphelper' ) {
        system("/root/bin/backuphelper skipuser $user");
    }
        print "\n[+] The next home directory and database backup will be skipped for $user.\n";
}

if ( $option eq 'db' ) {
    system("touch /home/$user/.skip_next_db_backup");
        print "\n[+] The next MySQL database backup will be skipped for $user.\n";
}
EOF
