You are not logged in.

#1 2010-05-09 02:56:46

pojo87
Member
Registered: 2010-04-29
Posts: 20

[SOLVED]automatically move objects to seperate folders

Hey guys i just need help with configuring the way things are organized.
I already know how to mv *.jpg, *.png etc,..
but i need a way to monitore my root folder so that anything i dont want to be in there gets moved to the correct folder. smile

Last edited by pojo87 (2010-05-10 03:04:31)

Offline

#2 2010-05-09 03:12:36

tesjo
Member
Registered: 2007-11-30
Posts: 164

Re: [SOLVED]automatically move objects to seperate folders

You'll need to be a bit more specific, and you will also receive more help here if you post what you've tried (ie a script).

I dont know about real-time monitoring, but if it is something like maintenance you could setup a cron job for a frequently as you need.

Offline

#3 2010-05-09 03:13:26

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: [SOLVED]automatically move objects to seperate folders

How do you define "don't want". The computer cannot read minds.

Offline

#4 2010-05-09 03:27:42

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED]automatically move objects to seperate folders

if you want files moved in real time, sort of like a watch folder, you'll need to use something like inotify. inotifywait (part of inotifytools) can be implemented pretty easily in a while loop of a bash script.

Offline

#5 2010-05-09 05:15:36

pojo87
Member
Registered: 2010-04-29
Posts: 20

Re: [SOLVED]automatically move objects to seperate folders

I havent written a script but i suppose i could write a script to run something like
mv *.jpg *.png pictures
or something like that to run at startup time but i need something to monitor my files and organize them accordingly.
I'll checkout inotify but if theres anoy other solution please send them my way. smile

Offline

#6 2010-05-09 06:30:01

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: [SOLVED]automatically move objects to seperate folders

inotify is not only the best solution, but The Solution.
And it's such a pleasure working with. There's bindings for virtually any
language.

Offline

#7 2010-05-09 10:12:33

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED]automatically move objects to seperate folders

A cron job would be enough.
You can safely move all your goat porn to that special hidden dir ~/foo/bar/baz/x2jksdflad/nothing_to_see_here

Offline

#8 2010-05-10 03:04:14

pojo87
Member
Registered: 2010-04-29
Posts: 20

Re: [SOLVED]automatically move objects to seperate folders

Thanks for the suggestions.
I haven't actually had time on my archbook but I'll just mark this as solved anyways seeing as inotify is probably the way to go.
thanks again guys smile

Offline

#9 2010-05-10 06:09:40

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED]automatically move objects to seperate folders

pojo87 wrote:

i need a way to monitore my root folder so that anything i dont want to be in there gets moved to the correct folder. smile

No doubt you'll solve this some way, but I'd suggest taking a step back, and asking how this unwanted stuff gets in to your root folder in the first place? A regular user on a linux system has write permissions in $HOME only.

Offline

#10 2010-05-10 09:37:33

pojo87
Member
Registered: 2010-04-29
Posts: 20

Re: [SOLVED]automatically move objects to seperate folders

When i setup arch i forgot to add another regular user and just kept using root as my main user.
It's a problem i plan to fix when I stop being so lazy tongue

Offline

#11 2010-05-10 09:54:00

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: [SOLVED]automatically move objects to seperate folders

pojo87 wrote:

When i setup arch i forgot to add another regular user and just kept using root as my main user.
It's a problem i plan to fix when I stop being so lazy tongue

I still don't understand this mentality. There is no reason to use root day to day. Its convenience is minor in fact if anything, it will cause more problems for you.


neutral

Offline

#12 2010-05-10 10:08:19

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED]automatically move objects to seperate folders

pojo87 wrote:

When i setup arch i forgot to add another regular user and just kept using root as my main user.
It's a problem i plan to fix when I stop being so lazy tongue

So you're going to hack together some workaround in a script using inotify, instead of just setting up a user?

Offline

#13 2010-05-10 10:37:10

pojo87
Member
Registered: 2010-04-29
Posts: 20

Re: [SOLVED]automatically move objects to seperate folders

its more then that.
I tried adding a new user awhile ago but all my X settings and pretty much everything didn't work.
So when i get the time to reconfigure tint2, X, and anything else im using, Or find a way to copy all my root settings to that user then I'll go ahead and do that.
I tried copying my X settings and tint2rc but i kept getting an error so i gave up and just went with being root for a lil while longer.

Offline

#14 2010-05-10 10:40:59

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED]automatically move objects to seperate folders

Uhmm... X configuration is in /etc/X11 which means it's system-wide, not per-user.

Offline

#15 2010-05-10 10:46:03

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED]automatically move objects to seperate folders

> so i gave up and just went with being root for a lil while longer
O_o

It's a bit like playing tag w/ a crocodile ...
Hope you do backups often.

Offline

#16 2010-05-10 11:32:23

pojo87
Member
Registered: 2010-04-29
Posts: 20

Re: [SOLVED]automatically move objects to seperate folders

I don't know then whenever i would startx i would get an error hmm

Offline

#17 2010-05-10 12:51:46

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [SOLVED]automatically move objects to seperate folders

If you don't like facing the problem that you have (which to me sounds more like a generic user configuration problem than an X problem), then it's safer to go back to using the distro you used before. I'm sure on that one you could run as a regular user.

I suspect there is something wrong with the way you try to launch X as a user; if X runs for the root user, it will run for any user. As tomk said it uses a systemwide configuration.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#18 2010-05-11 00:13:08

pojo87
Member
Registered: 2010-04-29
Posts: 20

Re: [SOLVED]automatically move objects to seperate folders

I'm trying to fix it now, I'm pretty sure it has to do with openbox being on my root and not on my regular user.
Something along the lines of that I suppose.
Unfortunately my regular user has insufficient permissions to run pacman so i gotta figure out what it needs.
Honestly i could never go back to another distro, I've learned way to much from arch to go back now.
I learned more from simply installing it then i have with any other distro.
I love arch so far despite the issues that i have here and there, but honestly the fact that it's me fixing them and not some automated program
is fulfilling i guess i could say.

Offline

#19 2010-05-11 00:24:32

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: [SOLVED]automatically move objects to seperate folders

You can use sudo to run pacman as root. Or use su to switch to root then run pacman.

Offline

#20 2010-05-11 00:38:04

pojo87
Member
Registered: 2010-04-29
Posts: 20

Re: [SOLVED]automatically move objects to seperate folders

Yess i just setup my sudoers file and did this, but i can't seem to get X to work right.
It works fine on root but on my regular user it refuses to use openbox and instead goes to the default wm.

Offline

#21 2010-05-11 00:41:40

pojo87
Member
Registered: 2010-04-29
Posts: 20

Re: [SOLVED]automatically move objects to seperate folders

Nevermind i forgot i had to create a new xinitrc
So now all thats left is to copy my conky config and wallpaper over tongue
cheers tongue

Offline

Board footer

Powered by FluxBB