-1
dirを別のディレクトリにハードリンクしたいが、このスクリプトは動作しない。それはいくつかの奇妙な理由のためにすべてのディレクトリにハードリンクします。 "tv show dir"は 'moviesdestpath'、 'tvdestdestpath'、 'miscdestpath'にハードリンクされますbashハードリンクが動作しない
アイデア?
#!/bin/bash
tvdestpath="/rpn-san/downloads/complete/torrents/tvshows-ready/$2"
moviedestpath="/rpn-san/downloads/complete/torrents/movies-ready/$2"
miscdestpath="/rpn-san/downloads/complete/torrents/misc-ready/$2"
torrentid="$1"
torrentname="$2"
torrentpath="$3"
torrentdir="$torrentpath/$torrentname"
#hardlink to "tvshows-ready"
cp -al "$torrentdir" "$tvdestpath/"
sleep 5
cp -al "$torrentdir" "$moviesdestpath/"
sleep 5
cp -al "$torrentdir" "$miscdestpath/"
ご覧ください:http://www.shellcheck.net/ – Cyrus
私は 'cp'の' -l'オプションに慣れていません。どのバージョンのLinuxを使用していますか? – Beta
Linuxはディレクトリへのハードリンクを許可していません。 – Barmar