Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Bing

Members: 0
Guests: 9
Stats
Files
Topics
Posts
Members
Newest Member
481
3,740
19,396
629
DarrenPayn
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Smaug Snippets » [SNIPPET] save pfiles archive...
Forum Rules | Mark all | Recent Posts

[SNIPPET] save pfiles archive space
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Dec 29, 2005, 2:33 pm   Last edited Dec 29, 2005, 2:33 pm by Zarius
Go to the top of the page
Go to the bottom of the page

Zarius
Apprentice
GroupMembers
Posts69
JoinedApr 23, 2002

in pfiles.c change (2 places)

snprintf( buf, 512, "tar -cf %spfiles.tar %s*", PLAYER_DIR, PLAYER_DIR );


to

snprintf( buf, 512, "tar -czf %spfiles.tgz %s*", PLAYER_DIR, PLAYER_DIR );


might save a lot of space if you have a ton of pfiles.

:blues:
       
Post is unread #2 Dec 29, 2005, 6:17 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,644
JoinedJan 1, 2002

Good idea. Don't know why I didn't do that to begin with :)
       
Post is unread #3 Dec 29, 2005, 7:02 pm   Last edited Dec 29, 2005, 7:05 pm by remcon737
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,874
JoinedJul 26, 2005

Yea, it is a good idea.
One question though, I fiqured I would check my old code that had pfiles in it and i had the z and all added heh was it in the snippet at one point and time or was it something I decided to do at some point and time? :P If it wasn't then shame on me for adding it and not suggesting it lol.

Edit:
Heh looks like it was probably something I did while doing some other changes.
See heres what mine had.
  if(!VLD_STR(argument))
  {
    char buf[MSL];

    log_string("Manual pfile cleanup started by %s.", ch->name);
    buf[0] = '\0';
    sprintf(buf, "tar -czf pfiles_backup.tgz %s*", PLAYER_DIR);
    system(buf);
    sprintf(buf, "mv -f pfiles_backup.tgz %s", BACKUP_DIR);
    system(buf);
    pfile_scan(FALSE);
    return;
  }

and
    if(sysdata.CLEANPFILES == TRUE)
    {
      char buf[MSL];

      buf[0] = '\0';
      sprintf(buf, "tar -czf pfiles_backup.tgz %s*", PLAYER_DIR);
      system(buf);
      system("mv -f pfiles_backup.tgz " BACKUP_DIR);
      sysdata.new_pfile_time_t = current_time + 86400;
      save_sysdata(sysdata);
      log_string("%s", "Automated pfile cleanup beginning....";);
      pfile_scan(FALSE);
    }

heh, so I guess Shame on me...no?
       
Pages:<< prev 1 next >>