403Webshell
Server IP : 88.99.149.37  /  Your IP : 216.73.216.141
Web Server : nginx/1.31.2
System : Linux server-88-99-149-37 6.12.0-124.56.5.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 15 06:12:08 EDT 2026 x86_64
User : muralimurth ( 1015)
PHP Version : 8.4.23
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/doc/rsync/support/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/doc/rsync/support/idmap
#!/usr/bin/env python3
# This helper script makes it easy to use a passwd or group file to map values
# in a LOCAL transfer.  For instance, if you mount a backup that does not have
# the same passwd setup as the local machine, you can do a copy to/from the
# backup area as follows and get the differing ID values mapped just like a
# remote transfer to/from the backed-up machine would do:
#
# rsync -av --usermap=`idmap --to /mnt/backup/etc/passwd` \
#           --groupmap=`idmap --to /mnt/backup/etc/group` \
#           /some/src/ /mnt/backup/some/dest/
#
# rsync -av --usermap=`idmap --from /mnt/backup/etc/passwd` \
#           --groupmap=`idmap --from /mnt/backup/etc/group` \
#           /mnt/backup/some/src/ /some/dest/

import re, fileinput, argparse

NAME_ID_RE = re.compile(r'^(\w+):[^:]+:(\d+)')

def main():
    maps = [ ]
    for line in fileinput.input(args.files):
        m = NAME_ID_RE.match(line)
        if not m:
            continue
        if args.to:
            pair = (m[1], m[2])
        else:
            pair = (m[2], m[1])
        maps.append(':'.join(pair))
    print(','.join(maps))


if __name__ == '__main__':
    parser = argparse.ArgumentParser(description="Output usermap or groupmap args for rsync.", add_help=False)
    action = parser.add_argument_group()
    action = parser.add_mutually_exclusive_group(required=True)
    action.add_argument("--from", action="store_true", help="Output the map for use on the sending side.")
    action.add_argument("--to", action="store_true", help="Output the map for use on the receiving side.")
    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 name & id pairs. Defaults to stdin.")
    args = parser.parse_args()
    main()

# vim: sw=4 et

Youez - 2016 - github.com/yon3zu
LinuXploit