[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debian-users:56767] Re: USB に内臓した bash script を実行したい。



佐久間さん、助言を有難うございます。

頂いた助言に従って、
$ sudo /bin/sh Backup/backup.scr my_parameter_for_soft_link
と実行したところ、成功しました !

実行時の script log を示します。

なお、script log にも記録されていますように
  1) sudo なしでは permission error となる。
  2) noexec option の mount からの外し方を知らない。
  3) soft link は erro になり、付けられていない。(HD 上では link されて
います)
のですが、解決方法があれば、教授頂けると幸甚です。

助言を頂いた皆様、本当に、有難うございました。

==================== script log =============== ここから
1
2 Script started on Wed May 1 20:21:12 2013
3 jinos@TPX61:/media/usb0/saGos$ /bin/sh Backup/backup.scr direct_try_bin_sh
4 Hello. <<< 武藤さんの助言の記念
5 direct_try_bin_sh
6 less than 100
7 021    <<< 過去のコピーした Step021 が既に存在していたので失敗   
8 backuped: ./Backup/Backup.barn/Step021
9 ln: creating symbolic link
`./Backup/Backup.barn/Step021_direct_try_bin_sh': Operation not
permitted <<< symbolic link 失敗
10 linkedby: ./Backup/Backup.barn/Step021_direct_try_bin_sh
11 saGos
12 jinos@TPX61:/media/usb0/saGos$  <<< 再試行   
13 jinos@TPX61:/media/usb0/saGos$ sudo /bin/sh Backup/backup.scr
try_frm_sh_in_sh
14 [sudo] password for jinos:
15 Hello.
16 try_from_bin_sh          <<< soft link 名の為の string parameter
17 less than 100
18 022
19 backuped: ./Backup/Backup.barn/Step022 <<< backup.scr は成功 !
20 ln: creating symbolic link
`./Backup/Backup.barn/Step022_try_from_bin_sh': Operation not permitted
  <<< soft link はやはりダメ
21 linkedby: ./Backup/Backup.barn/Step022_try_from_bin_sh
22 saGos
23 jinos@TPX61:/media/usb0/saGos$
24 jinos@TPX61:/media/usb0/saGos$ ls -l Bachup/Backup.barn << typo miss
25 ls: cannot access Bachup/Backup.barn: No such file or directory
26 jinos@TPX61:/media/usb0/saGos$ ls -l Backup/Backup.barn/
27 total 352
28 drwxr-xr-x 5 jinos jinos 16384 Apr 14 15:53 Step001
29 drwxr-xr-x 5 jinos jinos 16384 Apr 14 15:55 Step002
30 drwxr-xr-x 5 jinos jinos 16384 Apr 14 15:57 Step003
31 drwxr-xr-x 5 jinos jinos 16384 Apr 14 16:09 Step004
32 drwxr-xr-x 5 jinos jinos 16384 Apr 14 17:06 Step005
33 drwxr-xr-x 5 jinos jinos 16384 Apr 15 08:08 Step006
34 drwxr-xr-x 5 jinos jinos 16384 Apr 15 08:13 Step007
35 drwxr-xr-x 5 jinos jinos 16384 Apr 16 08:21 Step008
36 drwxr-xr-x 5 jinos jinos 16384 Apr 17 09:15 Step009
37 drwxr-xr-x 5 jinos jinos 16384 Apr 22 13:03 Step010
38 drwxr-xr-x 5 jinos jinos 16384 Apr 22 13:04 Step011
39 drwxr-xr-x 5 jinos jinos 16384 Apr 22 16:26 Step012
40 drwxr-xr-x 5 jinos jinos 16384 Apr 24 15:28 Step013
41 drwxr-xr-x 5 jinos jinos 16384 Apr 24 15:34 Step014
42 drwxr-xr-x 5 jinos jinos 16384 Apr 24 16:21 Step015
43 drwxr-xr-x 5 jinos jinos 16384 Apr 24 17:39 Step016
44 drwxr-xr-x 5 jinos jinos 16384 Apr 25 09:12 Step017
45 drwxr-xr-x 5 jinos jinos 16384 Apr 29 08:32 Step018
46 drwxr-xr-x 5 jinos jinos 16384 Apr 29 14:26 Step019
47 drwxr-xr-x 5 jinos jinos 16384 Apr 29 19:44 Step020
48 drwxr-xr-x 5 jinos jinos 16384 May 1 20:22 Step021 << 前回 backup
copy したもの
49 drwxr-xr-x 5 jinos jinos 16384 May 1 20:23 Step022 << 今回 backup さ
れた directry
50 jinos@TPX61:/media/usb0/saGos$
51 jinos@TPX61:/media/usb0/saGos$
52 jinos@TPX61:/media/usb0/saGos$ ls -l Backup/Backup.barn/Step022/ <<<
出来た !
53 total 96
54 drwxr-xr-x 2 jinos jinos 16384 May 1 20:23 Backup
55 -rwxr-xr-x 1 jinos jinos 483 May 1 20:23 Bibliographies
56 -rwxr-xr-x 1 jinos jinos 530 May 1 20:23 Makefile
57 drwxr-xr-x 2 jinos jinos 16384 May 1 20:23 Snapshot
58 drwxr-xr-x 6 jinos jinos 16384 Apr 4 10:18 build
59 -rwxr-xr-x 1 jinos jinos 14542 May 1 20:23 readme.Step022
60 jinos@TPX61:/media/usb0/saGos$
61 jinos@TPX61:/media/usb0/saGos$
62 jinos@TPX61:/media/usb0/saGos$ exit
63 exit
64
65 Script done on Wed May 1 20:25:30 2013
==================== script log =============== ここまで

(2013年05月01日 19:30), fubabz wrote:
> 佐久間といいます。
>
> mountオプションに noexec が付いてるからじゃないでしょうか。
>
> スクリプトを直接起動しないで
> /bin/sh スクリプト パラメータ…
> で起動できませんか?
>
> sudo 経由の場合は
> sudo /bin/sh スクリプト パラメータ…
>
>
>
> 2013年5月1日 15:42 tanimura <tanimura@xxxxxxxxxxxxxxx
> <mailto:tanimura@xxxxxxxxxxxxxxx>>:
>
>     /dev/sdb1 /media/usb0 vfat
>     rw,sync,nodev,noexec,noatime,uid=1008,gid=1008,fmask=0022,dmask=0022,codepage=cp437,iocharset=euc-jp,shortname=mixed,errors=remount-ro
>     0 0
>
> -- 
> sakuma
-- 

with regards,
---
     Hitoshi TANIMURA
     tanimura@xxxxxxxxxxxxxxx
---