- using
pkgutil
# list all your installed packages
pkgutil --pkgs
# show your package info
pkgutil --pkg-info | [global] | |
| workgroup = WORKGROUP | |
| log file = /var/log/samba/log.%m | |
| max log size = 1000 | |
| server role = standalone server | |
| security = user | |
| map to guest = Bad Password | |
| server multi channel support = yes | |
| load printers = no | |
| printing = bsd |
| import logging | |
| # 获取logger对象,取名mylog | |
| logger = logging.getLogger("mylog") | |
| # 输出DEBUG及以上级别的信息,针对所有输出的第一层过滤 | |
| logger.setLevel(level=logging.DEBUG) | |
| # 获取文件日志句柄并设置日志级别,第二层过滤 | |
| handler = logging.FileHandler("log.txt") | |
| handler.setLevel(logging.INFO) # 过滤 低于这个级别的不写文件 |
This script can be used to backup essential configuration files from the Proxmox Virtual Enivronment (PVE) host.
The script will create backups using tar with specified backup prefix and date and time stamp in the file name. Script will also delete backups that are older then number of days specified.
To create backup script that will be executed every day we can create backup script in /etc/cron.daily/ folder. We need to make it writeable by root (creator) only, but readable and executable by everyone:
touch /etc/cron.daily/pvehost-backup
| on openTerminal(location, remoteHost, serverPort) | |
| tell application "System Events" | |
| -- some versions might identify as "iTerm2" instead of "iTerm" | |
| set isRunning to (exists (processes where name is "iTerm")) or (exists (processes where name is "iTerm2")) | |
| end tell | |
| tell application "iTerm" | |
| activate | |
| set targetTab to "" |