Giter Club home page Giter Club logo

Comments (2)

bexem avatar bexem commented on June 18, 2024 1

The script should already address that:

def move_file(move_cmd):
    src, dest = move_cmd
    try:
        if os_linux:
            stat_info = os.stat(src)
            uid = stat_info.st_uid
            gid = stat_info.st_gid
            # Move the file first
            shutil.move(src, dest)
            # Then set the owner and group to the original values <----------
            os.chown(dest, uid, gid)
            original_umask = os.umask(0)
            os.chmod(dest, permissions)
            os.umask(original_umask)
        else:  # Windows logic
            shutil.move(src, dest)
            # For more granular Windows permissions, you'd use the win32security module here.
        logging.info(f"Moved file from {src} to {dest} with original permissions and owner.")
        return 0
    except (FileNotFoundError, PermissionError, Exception) as e:
        logging.error(f"Error moving file: {str(e)}")
        return 1

But considering is apparently not working for you a workaround could be running the script like this instead:
sudo -u nobody python /path/to/plexcache.py

from plexcache.

collonix676 avatar collonix676 commented on June 18, 2024

The v1.3.1 release doesn't seem to include this code but I've copied across the most recent raw code and it looks to be working correctly now.

Thank you!

from plexcache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.