You are not logged in.

#151 2012-09-20 15:20:47

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,750

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

I just think with initscripts you could add a test for asd sync before shutdown just to make sure everything is ok, with systemd I am a little more in the dark. Maybe asd could log any output so we could check it syncs ok prior to shutdown...


Mr Green

Offline

#152 2012-09-20 15:34:57

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,613
Website

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

@mrg - you can add a logging step yourself if you're volunteering to test... use this patch which should work but I have not tested.

--- anything-sync-daemon  2012-09-20 11:23:27.363527867 -0400
+++ anything-sync-daemon  2012-09-20 11:29:53.350443701 -0400
@@ -71,11 +71,12 @@
      fi

      # sync the tmpfs targets to the disc
+     LOG=/home/YOURUSER/asd.log
      if [[ -e $LINK/.flagged ]]; then
-       su -c "rsync -a --delete --exclude .flagged '$LINK/' '$BACKUP/'" $USER
+       su -c "rsync -av --delete --exclude .flagged '$LINK/' '$BACKUP/' >>$LOG" $USER
      else
-       su -c "rsync -a '$BACKUP/' '$LINK/'" $USER
-       su -c "touch '$LINK/.flagged'" $USER
+       su -c "rsync -a '$BACKUP/' '$LINK/' >>$LOG" $USER
+       su -c "touch '$LINK/.flagged' >>$LOG" $USER
      fi
    fi
  done

Note that you MUST define a username in the patch or in /usr/bin/anything-sync-deamon so that the log file goes somewhere.
LOG=/home/YOURUSER


# patch -i logging.patch /usr/bin/anything-sync-daemon

Last edited by graysky (2012-09-22 12:31:24)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#153 2012-09-20 15:45:12

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,750

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

I will test it of course, just need a safe directory to sync to ram that is safe smile presume /var/log is still out of bounds...


Mr Green

Offline

#154 2012-09-20 15:56:11

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,613
Website

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

Mr Green wrote:

I will test it of course, just need a safe directory to sync to ram that is safe smile presume /var/log is still out of bounds...

Yeah, use a guinea pig directory for sure.  Do populate it w/ a good chunk of data.  Maybe 200 MB or so?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#155 2012-09-20 16:06:50

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,750

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

Ok on it.... Some justin bieber might do the trick smile


Mr Green

Offline

#156 2012-09-20 16:10:46

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,613
Website

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

Mr Green wrote:

Ok on it.... Some justin bieber might do the trick smile

I said guinea pig, not garbage dump tongue


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#157 2012-09-21 04:43:22

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,750

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

Not had any problems yet, checked to make sure service was running and found this

asd.service                loaded active exited

Mr Green

Offline

#158 2012-09-21 09:06:51

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,613
Website

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

Dunno for sure but that seems normal.  Just look to see that your target is symlinked.  If it is then it's active.  Also, what does the log say?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#159 2012-09-21 10:27:14

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,750

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

No log nothing naa daa....


Mr Green

Offline

#160 2012-09-22 12:30:57

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,613
Website

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

Ack... forgot to specify a log file.  Edited the patch. All you need to do is add "/asd.log" to the LOG=line in /usr/bin/anything-sync-daemon like this:

LOG=/home/YOURUSER/asd.log

Last edited by graysky (2012-09-22 12:32:00)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#161 2012-09-22 12:47:51

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,750

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

Thought it looked odd added asd.log  smile


Mr Green

Offline

#162 2012-09-22 13:33:21

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,613
Website

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

Cool, plz report back your findings with regard to systemd waiting for a sync.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#163 2012-09-22 14:20:58

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,750

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

At the moment asd.log is empty really need to test it on an active directory....


Mr Green

Offline

#164 2012-09-23 06:55:44

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,750

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

Ok .... what I have this morning

sending incremental file list
./

sent 29 bytes  received 15 bytes  88.00 bytes/sec
total size is 0  speedup is 0.00
sending incremental file list
./

sent 29 bytes  received 15 bytes  88.00 bytes/sec
total size is 0  speedup is 0.00

Mr Green

Offline

#165 2012-10-16 16:18:09

X-dark
Member
From: France
Registered: 2009-10-25
Posts: 135
Website

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

Quick question, what is happening if a power failure happens during the rsync? Will my data get corrupted?
Did you consider using the "--delay-updates" rsync option (not sure if it is enough to have a real atomic operation)?


Cedric Girard

Offline

#166 2012-10-16 19:09:11

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,613
Website

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

@Xd - Not sure.  One could ask the same question for a standard write operation to a HDD as well.  I do like your suggestion to add the --delay-updates switch which should make it a safer operation.  I will test and implement.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#167 2012-10-17 16:24:41

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,613
Website

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

v3.07 is released with this suggestion.  Thank you.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#168 2012-10-18 08:48:34

fabertawe
Member
From: Lloegr
Registered: 2009-11-24
Posts: 258

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

Won't "--delay-updates" actually write to the disk twice though? Or have I got this wrong?


i7 4790K 4.4GHz, ASRock Z97 Extreme6, 16GB 2400MHz, GTX 970, Arch x86_64

Offline

#169 2012-10-18 21:47:40

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,613
Website

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

fabertawe wrote:

Won't "--delay-updates" actually write to the disk twice though? Or have I got this wrong?

No, it just rotates the files from the temp names to the actual names.  You can verify this with:

# iotop -Pao

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#170 2012-10-19 08:14:41

fabertawe
Member
From: Lloegr
Registered: 2009-11-24
Posts: 258

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

Ah, ok, thanks for clarifying. That actually makes a lot more sense. Thanks for all your work, really enjoying your packages smile


i7 4790K 4.4GHz, ASRock Z97 Extreme6, 16GB 2400MHz, GTX 970, Arch x86_64

Offline

#171 2012-10-19 09:43:56

X-dark
Member
From: France
Registered: 2009-10-25
Posts: 135
Website

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

graysky wrote:

v3.07 is released with this suggestion.  Thank you.

Thanks.


Cedric Girard

Offline

#172 2012-10-22 17:51:11

mandos
Member
From: Greece
Registered: 2006-01-23
Posts: 100
Website

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

Can I use anything-sync-daemon for mysql?

In my development pc I decided to add lots of ram, to use it for local web development.
Everything mysql-related is under /srv/mysql, if I could put the databases in ram my dev-environment would fly!

Is there anything I should check? Will it sync back to the file-system on shutdown?
I'm under systemd, so the order the services start isn't configured by me.

Offline

#173 2012-10-22 18:49:30

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,613
Website

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

mandos wrote:

Can I use anything-sync-daemon for mysql?

In my development pc I decided to add lots of ram, to use it for local web development.
Everything mysql-related is under /srv/mysql, if I could put the databases in ram my dev-environment would fly!

Is there anything I should check? Will it sync back to the file-system on shutdown?
I'm under systemd, so the order the services start isn't configured by me.

I don't see why it wouldn't work.  Backup your databases before attempting would be good advice.  Plz report back.  And yes, it syncs back on shutdown and once per hour.  See the wiki page for more (or the man page).


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#174 2012-11-01 01:12:47

ndejay
Member
Registered: 2012-10-30
Posts: 7

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

Amazing job at anything-sync-daemon and profile-sync-daemon, it works like a charm on my system! However, wouldn't deleting a file off a "RAM-cached" disk re-spawn after reboot (because of rsync and _backup folders)? Is there a solution to this other than deleting the files at both places?

EDIT: Removed a stupid question I figured out after hitting "post"

Last edited by ndejay (2012-11-01 01:13:30)

Offline

#175 2012-11-01 01:26:03

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,613
Website

Re: anything-sync-daemon - keep ANYTHING in tmpfs and sync'ed

I'm confused... The daemon effectively makes your system have a single location.  If you delete something from tmpfs, so long as you stop the daemon gracefully, the changes are committed to disk.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB