#!/bin/sh
#

src='rsync://your.anrip.com:873' #源路径
dst='/mnt/backup' #目标路径
dir='project' #待同步的项目

opt="-rltPv --delete" #同步选项

num=32 #进程数
depth='4 3 2 1' #归递目录深度

skip=/tmp/`echo $src$dir | md5sum | head -c 16`.skip
[ -f $skip-next ] && cp $skip-next $skip
[ -f $skip ] || touch $skip

# 创建目标目录结构
rsync $opt --include "*/" --exclude "*" $src/$dir/ $dst/$dir

# 进入本地索引目录
cd $dst

# 从深到浅同步目录
for l in $depth ;do
    # 启动rsync进程
    for i in `find $dir -maxdepth $l -mindepth $l -type d`; do
        if `grep -q "$i$" $skip`; then
            echo "skip $i"
            continue
        fi
        while true; do
            now_num=`ps axw | grep rsync | grep $dir | grep -v '\-\-daemon' | wc -l`
            if [ $now_num -lt $num ]; then
                rsync $opt $src/$i/ $dst/$i &
                echo $i >>$skip-next
                sleep 1
                break
            else
                sleep 5
            fi
        done
    done
done

# 最终单进程验证
while true; do
    sleep 5
    now_num=`ps axw | grep rsync | grep $dir | grep -v '\-\-daemon' | wc -l`
    if [ $now_num -lt 1 ]; then
        rsync $opt $src/$dir/ $dst/$dir
        break
    fi
done

真是好记性不如烂笔头啊,以前经常用的命令,一时竟然没想起来

sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/your-disk-name /Applications/Install\ macOS\ Mojave.app —nointeraction

  • database, public,schema1 为你需要修改的库名
  • username 为更改后的所有者用户名
\c database;

DO $$
DECLARE
    r record;
    i int;
    v_schema text[] := '{public,schema1}';
    v_new_owner varchar := 'username';
BEGIN
    FOR r IN
        SELECT 'ALTER TABLE "' || table_schema || '"."' || table_name || '" OWNER TO ' || v_new_owner || ';' AS a FROM information_schema.tables WHERE table_schema = ANY (v_schema)
        UNION ALL
        SELECT 'ALTER TABLE "' || sequence_schema || '"."' || sequence_name || '" OWNER TO ' || v_new_owner || ';' AS a FROM information_schema.sequences WHERE sequence_schema = ANY (v_schema)
        UNION ALL
        SELECT 'ALTER TABLE "' || table_schema || '"."' || table_name || '" OWNER TO ' || v_new_owner || ';' AS a FROM information_schema.views WHERE table_schema = ANY (v_schema)
        UNION ALL
        SELECT 'ALTER FUNCTION "' || nsp.nspname || '"."' || p.proname || '"(' || pg_get_function_identity_arguments(p.oid) || ') OWNER TO ' || v_new_owner || ';' AS a FROM pg_proc p JOIN pg_namespace nsp ON p.pronamespace = nsp.oid WHERE nsp.nspname = ANY (v_schema)
        UNION ALL
        SELECT 'ALTER DATABASE "' || current_database() || '" OWNER TO ' || v_new_owner
    LOOP
        EXECUTE r.a;
    END LOOP;
    FOR i IN array_lower(v_schema, 1)..array_upper(v_schema, 1)
    LOOP
        EXECUTE 'ALTER SCHEMA "' || v_schema[i] || '" OWNER TO ' || v_new_owner;
    END LOOP;
END
$$;

一、创建一个空白分支

git checkout --orphan <new_branch>
git rm -rf .

二、首次提交并推送到远程服务

echo > .gitignore
git add .gitignore
git commit -m "first commit"
git push origin <new_branch>

上次写了基于离线包的升级方式。今天写一下在线升级的基本步骤。

一、查看可用的更新包

esxcli software sources profile list -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml | grep ESXi-6.7

二、执行在线更新(不含TOOLS,防止 No Space Left On Device)

esxcli software profile update -p ESXi-6.7.0-20190802001-no-tools -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml

三、单独更新TOOLS

esxcli software vib install -v https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/esx/vmw/vib20/tools-light/VMware_locker_tools-light_10.3.10.12406962-14141615.vib

四、重启服务器

reboot

ESXi Version 6.7.0 History

https://esxi-patches.v-front.de/ESXi-6.7.0.html