Accidentally started and quickly stopped a rm-rf on my /home/account/ dir. Looking for advice/help


#1

Dufus award of the year goes to me. Was trying to delete old quickVPN accounts/dirs and for whatever reason, I had one named exactly like my home account name. So I started and then stopped (closed ssh out once I realized) a rm -rf on a home/main_account dir while within /home. Looking for advice on how to proceed.

  1. Can I re-run an installation of quickbox.io without loosing any current data (and possibly having it replace anything that may have been deleted in regards to the quickbox.io infrastructure on my server)?

  2. As of now, my dashboard, rutorrent, and plex are accessible and working. However, some things have changed from what I remember. Maybe posting this will help someone help me identify what damage has been done.

When first logging in to SSH, I now see -bash-4.3$

When loggin in further as su, things still look normal

And when listing my home account directory with ls-la, it seems some folders/files/data are missing (as the list used to be a bit longer)

What I do know is that a torrent directory of mine for a specific tracker did get removed (~380 files). All other tracker directories remain thankfully (and I’ll be rechecking data on all torrents soon).

From what I’ve mentioned, how much damage do you think I’ve done rm -rf’ing my main /account/ while in /home for ~15 sec or so? Thankfully, this wasn’t a rm -rf on /, so I’m trying to figure out if thing’s are screwed up and not yet noticeable .

I’ll happily post a [ls -alR] for /home/account_name/ but need to check if anything important would shown.

Appreciate the help, and I’ll take any ideas on how to go about repairing this as much as possible.

P.S I’ve been thinking of switching servers as of lately, so how easy would it be to move over all data regarding rtorrent/torrents and have them propagating correctly on the new server?


#2

For starters, it looks like you’re on a somewhat old version, that should be addressed. You can update by doing the following:

####Remove the old /root/QuickBox directory

rm -rf ~/QuickBox

We are now stashing the local repo for updates etc in /etc/QuickBox/

####Restore the new setup for your repo with this:

git clone https://github.com/QuickBox/QB /etc/QuickBox; \
wget -O /usr/local/bin/quickbox/system/updateQuickBox https://raw.githubusercontent.com/QuickBox/QB/master/packages/system/updateQuickBox; \
dos2unix $(find /usr/local/bin/quickbox -type f) && chmod +x $(find /usr/local/bin/quickbox -type f)

If you somehow have an /etc/QuickBox directory, run rm -rf /etc/QuickBox and continue.

####Now let’s run the update with the following:

updateQuickBox

Once you have done that, report back and let us know. As per

Absolutely you can, but please update first, or you’ll certainly encounter some errors. Running the installer once more, simply use your existing username and password, it should replace any deleted directories that are needed as well as keep all of your data in tact.


#3

Thank you so much for the reply.

  • I did not already have a Quickbox dir in /root.
  • I did however already have a Quickbox dir in /etc/, so I removed it.
  • I then ran the (restore new setup for your repo 3 line command).
  • And lastly, ran updateQuickBox. It completed with the following lines:

Already on 'master’
Your branch is up-to-date with ‘origin/master’.
Already up-to-date.

You mentioned reporting back, so here’s a reply just in case (unless you meant after running the initial instillation setup again as well).

Regardless, running it now and I’ll report back if any issues. Thank you again!!


#4

Btw, does it matter if I run the initial install script under -bash-4.3$ (when I initially ssh into the server), or should i run it after su 'ing further into the shell?

And it’s been a while, so which would be my exiting username of the quickbox insatllation?

cuteUbuntu:/home/cute

cuteUbuntu (which I see once I su), or cute (which is my main account directory under home)?

Sorry If these are dumb questions. I tend to set and forget now a days.


#5

You will be using your master account username and password, the one you initially setup QuickBox with. You can do cat /root/information.info to see your username:password. However, it should be the one you use to login to the dashboard with.

Once you login, yes, do sudo su to gain root, then run the initial installer once more with
bash /etc/QuickBox/setup/quickbox-setup


#6

You’re the best. If you have a bitcoin wallet or paypal account, I’ll gladly throw a tip your way. Or I can donate directly to quickbox. Just want to show my appreciation for how helpful you’ve been. Let me know, and have a great rest of the day!

Edit: Shoot, it seems rtorrent/rutorrent got completely wiped. If you’ve got one more second, how would I go about fixing these issues that popped up when accessing rutorrent.

08.06.2017 14:29:13] Webserver user doesn’t have read/write/execute access to the torrents directory. You cannot add torrents via ruTorrent. (/srv/rutorrent/share/users/cute/torrents)
[08.06.2017 14:29:13] rTorrent user must have read/execute access to the torrents directory. You cannot add torrents via ruTorrent. (/srv/rutorrent/share/users/cute/torrents)

Edit 2: Could there also be a way to find a config file that could restore my rtorrent back to how it was?


#7

Could you post the permissions of

ls -l /srv/rutorrent/share/users/cute

Also, is that torrents directory in the users share empty?


#8

cuteUbuntu:/home/cute# ls -l /srv/rutorrent/share/users/cute
total 4.0K
drwxrwxrwx 6 www-data www-data 4.0K Jun 8 20:29 settings

And the torrents dir in [home/cute/torrents] isn’t empty. It hold dir rtorrent which holds all my tracker dir’s and all the torrent files. rtorrent just didn’t save any of the seeding torrents, so it looks like I have to re-add and force check. If there is some hidden config file that could restore it, that would be great but I doubt it.


#9

Yeah, there should be a /srv/rutorrent/share/users/cute/torrents directory as well.
Could you create it with the following:

mkdir -p /srv/rutorrent/share/users/cute/torrents
chown -R www-data:www-data /srv/rutorrent/share/users/cute/torrents
chmod 777 /srv/rutorrent/share/users/cute/torrents

No hidden config file to restore them unfortunately as once they are deleted they are deleted.


#10

Gotchya. Oh well. rtorrent/rutorrent did still have all the torrent files loaded before initiating the quickbox-setup. For future reference, what can i save/backup when doing a quickbox-setup reinstall to keep rtorrent intact?


#11

Check your /home/cute/.sessions folder, make a backup of that. This should contain all the .torrents needed for the recheck (without having to add them in). It’s possible that directory got wiped on the rebuild, although, I don’t honestly know how or why that would happen, I’ll look into it though.

That and your /home/cute/torrents directory would be vital, but again, those should stay in tact.

Any .config, .bin and .autodl directories present should be backed up locally so you don’t overwrite existing settings. Just in case (for whatever reason) the reinstall decides to wipe them, you’ll at least have them there as a backup.


#12

Thanks once again for the info and help.