403Webshell
Server IP : 178.105.222.151  /  Your IP : 216.73.216.38
Web Server : nginx/1.28.3
System : Linux MNK 7.0.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Wed Apr 22 16:06:43 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.5.4
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/share/rsync/scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/rsync/scripts/files-to-excludes
#!/usr/bin/python3
# This script takes an input of filenames and outputs a set of include/exclude
# directives that can be used by rsync to copy just the indicated files using
# an --exclude-from=FILE or -f'. FILE' option. To be able to delete files on
# the receiving side, either use --delete-excluded or change the exclude (-)
# rules to hide filter rules (H) that only affect the sending side.

import os, fileinput, argparse

def main():
    paths = set()
    for line in fileinput.input(args.files):
        dirs = line.strip().lstrip('/').split('/')
        if not dirs:
            continue
        for j in range(1, len(dirs)):
            if dirs[j] == '':
                continue
            path = '/' + '/'.join(dirs[:j]) + '/'
            if path not in paths:
                print('+', path)
                paths.add(path)
        print('+', '/' + '/'.join(dirs))

    for path in sorted(paths):
        print('-', path + '*')
    print('-', '/*')


if __name__ == '__main__':
    parser = argparse.ArgumentParser(description="Transform a list of files into a set of include/exclude rules.", add_help=False)
    parser.add_argument("--help", "-h", action="help", help="Output this help message and exit.")
    parser.add_argument("files", metavar="FILE", default='-', nargs='*', help="The file(s) that hold the pathnames to translate. Defaults to stdin.")
    args = parser.parse_args()
    main()

# vim: sw=4 et

Youez - 2016 - github.com/yon3zu
LinuXploit