Change permissions:
TEXT
find . -type f -print0 | xargs -0 chmod 664 // files
find . -type d -print0 | xargs -0 chmod 775 // directories sau 775
Change owner:
TEXT
chown -R user:group file_name
# for web servers add www-data as group and add the user to www-data group
# check if user is in group www-data: groups user
# if it's not add it and change permissions:
chown -R catalin:www-data file_name
Persist group:
TEXT
chmod g+s
Persist permissions
TEXT
umask 022 (= 755 or 002 = 775)
Backup
TEXT
rsync --progress --numeric-ids -avz --delete --rsync-path="sudo rsync" /mnt/lxc/ user@host:/mnt/lxc