Comments (2)
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.
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)
- Allow user to define which Sections to process
- /mnt/user/system/./locatefileinarray.sh: No such file or directory HOT 4
- Setup.py "no such file exists in directory" HOT 39
- Feeling dumb... HOT 91
- FileNotFoundError HOT 5
- Feature request HOT 42
- Error: [Errno 2] No such file or directory. Files exist can touch and ls. HOT 47
- Conflict with Mover/Mover Tuning HOT 10
- Monitor "Now playing" and move to cache? HOT 6
- Some Watchlist "Problems" HOT 63
- Looking for Clarification regarding use in Ubuntu HOT 18
- Error moving file HOT 6
- First run not working properly, 2nd run will not run due to not enough size HOT 1
- OnDeck read error.
- Run in a container / as a plug in?
- how to setup correctly if movies/tv are on differents NAS/Unraid server HOT 3
- Feature request: Add ability to monitor "Watched" content and move it to array HOT 1
- CRITICAL - Error checking free space and moving media files to the array: [Errno 2] No such file or directory: HOT 4
- Feature request: Add support for creating Unraid Mover ignore file HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plexcache.