Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Where can I store command line aliases so they won't periodically disappear and need to be restored?

Featured Replies

I've tried save aliases, such as:

 

# My aliases
alias vsync_full="rsync -rltOuv --delete --force /mnt/user/video/ [email protected]:/mnt/user/video/"
alias cdv="cd /mnt/user/video"
alias ll="ls -l --time-style=+%F\\ %T"
alias lla="ls -lA --time-style=+%F\\ %T"


...into both /root/.bash_profile and /etc/profile, but either place I put them, they are soon after cleared away and I have to restore them again.

 

Is there a better place where my aliases with reliably persist?

Solved by Squid

  • Solution

Unraid starts fresh with every reboot, so you need to save the changes on the flash drive somewhere and then re-apply them via the go file (/config/go) or user scripts when the system starts up.

  • Author
2 hours ago, Squid said:

Unraid starts fresh with every reboot, so you need to save the changes on the flash drive somewhere and then re-apply them via the go file (/config/go) or user scripts when the system starts up.

 

So, should editing the go file to something like this do the trick?

 

#!/bin/bash
# Start the Management Utility
/usr/local/sbin/emhttp &
cat /boot/config/my_profile >> /etc/profile

 

I'd test it right now, but it's a bad time for a reboot at the moment.

  • Author
4 hours ago, RasterEyes said:

I'd test it right now, but it's a bad time for a reboot at the moment.

 

I got a chance to reboot just now, and the change based on Squid's suggestion works great. Thanks.

  • 4 months later...
On 8/28/2023 at 5:46 AM, RasterEyes said:

 

I got a chance to reboot just now, and the change based on Squid's suggestion works great. Thanks.

so to be more exact:
- I create a script somewhere on my flashdrive (for instance /boot/config/aliases.sh)
- I set this script to launch in the /boot/config/go file
- all done?

Or your way? You copy the profile?

 

On 8/27/2023 at 10:59 PM, Squid said:

Unraid starts fresh with every reboot, so you need to save the changes on the flash drive somewhere and then re-apply them via the go file (/config/go) or user scripts when the system starts up.

 

  • Author
On 1/8/2024 at 10:06 AM, Kees Fluitman said:

Or your way? You copy the profile?

I'm a little confused about what you're referring to as "my way", so I'll just try to be more clear about what worked for me:

 

I created a file, /boot/config/my_profile (could be /boot/config/anything_you_want) which contained the extra stuff I wanted to append to /etc/profile -- just the extra stuff, not the full contents of that file. The only extras I wanted to add for myself were aliases, but you can add any other set-up commands you like. 

I then edited the existing /boot/config/go file to add this extra line:

 

cat /boot/config/my_profile >> /etc/profile

 

This causes my desired changes to be appended to /etc/profile at start-up.

yes perfect. i did it that way as well.

root@server:/boot/config# cat /boot/config/go
#!/bin/bash
# Start the Management Utility
/usr/local/sbin/emhttp &
cat /boot/config/kees_aliases >> /etc/profile

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.