これは今のところ私を困惑させているので、長い時間とたくさんのコーヒーを飲んだ後、私が知っている最高のコーディングコミュニティに助けを求めています.
基本的に、先に進む前にファイルがサーバーに存在しなくなるのを待つための perl スクリプトが必要です。すべてのスクリーンセッションが終了するのを待つことを実際に検討しています(/ var/run/screenが空のディレクトリになる)。
#!/usr/bin/perl
my $directory="/root/screens";
opendir(DIR, $directory) or die "couldn't open $directory: $!\n";
my @files = readdir DIR;
closedir DIR;
foreach (@files){
while (-e $_) {
print "$directory has $_ existing\n";
sleep 1;
}
}
Ex Dir.
total 8
drwxr-xr-x. 2 root root 4096 Oct 11 22:58 ./
drwxr-x---. 17 root root 4096 Oct 11 05:33 ../
-rw-r--r--. 1 root root 0 Oct 11 22:58 S-root
-rw-r--r--. 1 root root 0 Oct 11 22:58 S-root1
上記は明らかに機能しませんが、Google でこれを行う良い方法が見当たらず、長い 1 日でした。