Change path??

Status
Not open for further replies.

cpotter638

Dabbler
Joined
Nov 25, 2011
Messages
28
Just set up my 1st FreeNAS box. Complete NOOB. Have Unix experience in the past, but it was basic and 15+ yrs ago.

Starting to play some at the command line. Want to create a cron job to backup FreeNAS config file. So:

Thought about creating a script that would run via GUI cron job.
Want to create a "Scripts" folder on my mounted volume. And include this folder in my path.

I'm trying to change the path.
Tried "nano .cshrc". It opens in nano, but I get "no write permission".
As such, tried "chmod 755 .cshrc" with intent of changing permissions temorarily and then changing permissions back to original. However, I get "chmod: .cshrc: Read-only file system".

What am I doing wrong?

Thanks for the help.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Hi Cpotter,

You can't do things the way you're trying on FreeNAS, the filesystem (flash drive) where .cshrc is stored is read-only and you don't need to add the folder for the script to your path. Just create your script, put it in the folder you want to save it in, then just put the full path to the script in the GUI when you create the Cron job there. Don't forget to make your script executable also, chmod 750.
 

cpotter638

Dabbler
Joined
Nov 25, 2011
Messages
28
Protosd,

Thanks for the quick answer. Just so I understand 100% for future applications - no way to permanently change the path in FreeNAS? Instead, just need to use the full path when executing a file?
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
The short explanation is you can make the filesystem read-write (mount -uw /) and change it, it's been covered many times here (FAQ). The proper way to do with with FreeNAS is the way I explained it to you. If you do it outside the GUI, it either won't persist during a reboot, or will get lost during an upgrade. Under normal Unix conditions, you could do it the way you're thinking without the other issues.
 

cpotter638

Dabbler
Joined
Nov 25, 2011
Messages
28
Thanks for the explanation. I'll proceed with your initial method. I'll also review some of the linked threads in FAQ. Thanks again.
 
Status
Not open for further replies.
Top