Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission and Ownership Backup #10

Open
hardik4mail opened this issue Mar 13, 2018 · 0 comments · May be fixed by #16
Open

Permission and Ownership Backup #10

hardik4mail opened this issue Mar 13, 2018 · 0 comments · May be fixed by #16

Comments

@hardik4mail
Copy link

hardik4mail commented Mar 13, 2018

We should add an option to backup of existing permission and ownership for all users.
Below is code snippet for your review.

backupdir="/root/fixperms_backups/fixperms_backups_'date +%s'"
mkdir -p $backupdir

function permsbkp
{
	local user=$1
	local home_dir=$2
	echo "Backing up permissions for $user"
	find $home_dir -printf 'chmod %#m "%p"\n' > ${backupdir}/${user}-perms_backup_'date +%s'.sh
	echo "Backing up ownerships for $user"
	find $home_dir -printf 'chown %u:%g "%p"\n' > ${backupdir}/${user}-owners_backup_'date +%s'.sh
}
lsthompson added a commit to The-Network-Crew/cPanel-fixperms that referenced this issue Jan 5, 2023
-b option for perms/ownership backup to resolve PeachFlame#10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant