John
John

Reputation:

How to supply password in crontab

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

Upvotes: 0

Views: 1767

Answers (2)

Brad Mace
Brad Mace

Reputation: 27886

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.

Upvotes: 0

Cameron Laird
Cameron Laird

Reputation: 1075

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

Upvotes: 2

Related Questions