views:

36

answers:

2

I am writing the command in crontab and its output is first asking the password.

Is there any way to supply the password with command like

mount -a < password
+2  A: 

Yes: with Expect http://wiki.tcl.tk/201 > http://en.wikipedia.org/wiki/Expect >.

Cameron Laird
A: 

Edit:

Seems like you must be mounting some type of remote filesystem. Those usually have special options that allow you to supply the password if you don't want to muck around with 'expect'. For samba, you can do this:

mount -t smbfs -o username=thisguy,password=abc123 //winserver/stuff /mnt/stuff

The username and password options can also be placed in your /etc/fstab file in the column with the options like ro,rw,noauto, etc.

bemace
Actually i am using the crontab as root but still it is asking for password
Mirage