通过 Dropbox 远程执行 linux 上的命令?

Execute commands on linux remotely through Dropbox ?

我在一个拥有 linux 机器的大型实验室工作,我们用它来做 CGI 的东西。基本上,我希望能够在我在家时(在这里使用 Windows)在我登录的机器上执行命令。到目前为止,我已经能够将终端的输出实时写入保存在 dropbox 上的 txt 文件中,这样我就可以在家时检查进程的进度。所以我正在考虑一种逆转这个过程的方法。是否可以将命令保存在 dropbox 上的 txt 或 sh 文件中,并在我实验室的机器上有一个进程,该进程不断查看此文件并执行其中写入的命令?

安装inotify-tools

Ubuntu:

sudo apt-get install inotify-tools

代码

inotifywait -m ~/Dropbox -e create -e moved_to |
    while read path action file; do
        echo "The file '$file' appeared in directory '$path' via '$action'"
        # do something with the file
    done

这对我有用