📌  相关文章
📜  使用其他用户 linux 运行特定脚本 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:12.333000             🧑  作者: Mango

代码示例1
/bin/su -c "/path/to/backup_db.sh /tmp/test" - postgres

Breaking it down:
 /bin/su : switch user
 -c "/path/to..." : command to run
 - : option to su, make it a login session (source profile for the user)
 postgres : user to become