<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	
	>
<channel>
	<title>
	Comments on: Compress Old Log Files on Linux	</title>
	<atom:link href="https://www.krazyworks.com/compress-old-log-files-on-linux/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.krazyworks.com/compress-old-log-files-on-linux/</link>
	<description>Networking, Systems Design, and Disaster Recovery</description>
	<lastBuildDate>Wed, 26 Aug 2015 15:26:58 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.7.9</generator>
	<item>
		<title>
		By: Shay H		</title>
		<link>https://www.krazyworks.com/compress-old-log-files-on-linux/comment-page-1/#comment-247941</link>

		<dc:creator><![CDATA[Shay H]]></dc:creator>
		<pubDate>Sun, 31 Mar 2013 01:46:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.krazyworks.com/?p=2677#comment-247941</guid>

					<description><![CDATA[In windows 7 and windows xp, is there a log file that memorizes every internet connection that has been established in a particular time,day, week, month?

If there is such a thing, where can I find it?
]]></description>
			<content:encoded><![CDATA[<p>In windows 7 and windows xp, is there a log file that memorizes every internet connection that has been established in a particular time,day, week, month?</p>
<p>If there is such a thing, where can I find it?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Disrae		</title>
		<link>https://www.krazyworks.com/compress-old-log-files-on-linux/comment-page-1/#comment-247773</link>

		<dc:creator><![CDATA[Disrae]]></dc:creator>
		<pubDate>Sat, 30 Mar 2013 01:03:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.krazyworks.com/?p=2677#comment-247773</guid>

					<description><![CDATA[I was turning my computer off one day and when it would not turn off, I held the power switch and it turned on and off real quick. Now when I turn it back on, it will turn off when it hits the Windows Vista loading screen, like right when it gets to it, it does not restart just shuts off and it is annoying. People are saying its the PSU which I doubt it because when I hit F2 or F10 to go to those menus when I first start my computer, the computer stays running perfectly until it try to boot it in safe mode or boot it normal mode. 

This happened to me before when a friend messed my computer up and I found my old installation disk for vista and put it in and it worked perfectly, but now when I try to put the disk in, it shuts off when it tries to load up.

When all that happens, my computer will not even turn on when I hit the power switch, it only turns on after I unplug the computer, open the case, close the case, then plug it back in, but when I turn it off, it shuts off at the loading screen and then wont turn on again until I unplug it all again, this sucks.

I tried re-seating the CMOS battery or whatever its called, someone said it might work, but it did not. My computer does the same thing over and over.

Please email me at kryptichellsing@hotmail.com 
or give a reasonable answer here or something. Thanks.
(Asking from my moms netbook right now)
]]></description>
			<content:encoded><![CDATA[<p>I was turning my computer off one day and when it would not turn off, I held the power switch and it turned on and off real quick. Now when I turn it back on, it will turn off when it hits the Windows Vista loading screen, like right when it gets to it, it does not restart just shuts off and it is annoying. People are saying its the PSU which I doubt it because when I hit F2 or F10 to go to those menus when I first start my computer, the computer stays running perfectly until it try to boot it in safe mode or boot it normal mode. </p>
<p>This happened to me before when a friend messed my computer up and I found my old installation disk for vista and put it in and it worked perfectly, but now when I try to put the disk in, it shuts off when it tries to load up.</p>
<p>When all that happens, my computer will not even turn on when I hit the power switch, it only turns on after I unplug the computer, open the case, close the case, then plug it back in, but when I turn it off, it shuts off at the loading screen and then wont turn on again until I unplug it all again, this sucks.</p>
<p>I tried re-seating the CMOS battery or whatever its called, someone said it might work, but it did not. My computer does the same thing over and over.</p>
<p>Please email me at <a href="javascript:DeCryptX('0k1s1z3s1u1j2e0h2g0l1m1t0i1o0g2B3k3r0t1n0a0i1m1/0c1p3p')">k&#114;&#121;pti&#99;&#104;e&#108;ls&#105;ng&#64;&#104;&#111;tm&#97;i&#108;.&#99;&#111;m</a><br />
or give a reasonable answer here or something. Thanks.<br />
(Asking from my moms netbook right now)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: mr flibble		</title>
		<link>https://www.krazyworks.com/compress-old-log-files-on-linux/comment-page-1/#comment-246988</link>

		<dc:creator><![CDATA[mr flibble]]></dc:creator>
		<pubDate>Sun, 24 Mar 2013 08:55:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.krazyworks.com/?p=2677#comment-246988</guid>

					<description><![CDATA[How do I enable sending router log files to my computer? The router I&#039;m using is th billion 7300NX and I cant find the settings to direct the logs.
]]></description>
			<content:encoded><![CDATA[<p>How do I enable sending router log files to my computer? The router I&#8217;m using is th billion 7300NX and I cant find the settings to direct the logs.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: slipknot0129		</title>
		<link>https://www.krazyworks.com/compress-old-log-files-on-linux/comment-page-1/#comment-246811</link>

		<dc:creator><![CDATA[slipknot0129]]></dc:creator>
		<pubDate>Sat, 23 Mar 2013 02:45:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.krazyworks.com/?p=2677#comment-246811</guid>

					<description><![CDATA[I dont understand what i have to do. It tells me the following:
If you have been using cPanel with your previous host then you need to create a full backup of your account on the old server, then transfer the backup files via FTP from the old server to your new account with JustHost. Please then inform us when this is done and we will restore your account from the backup provided by you.

If you were using another control panel then you need to download your website from the old server onto your local computer.  Then you need to upload your files from your local computer into your Just Host account which can be done via FTP.
]]></description>
			<content:encoded><![CDATA[<p>I dont understand what i have to do. It tells me the following:<br />
If you have been using cPanel with your previous host then you need to create a full backup of your account on the old server, then transfer the backup files via FTP from the old server to your new account with JustHost. Please then inform us when this is done and we will restore your account from the backup provided by you.</p>
<p>If you were using another control panel then you need to download your website from the old server onto your local computer.  Then you need to upload your files from your local computer into your Just Host account which can be done via FTP.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Thomas A		</title>
		<link>https://www.krazyworks.com/compress-old-log-files-on-linux/comment-page-1/#comment-246773</link>

		<dc:creator><![CDATA[Thomas A]]></dc:creator>
		<pubDate>Fri, 22 Mar 2013 18:38:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.krazyworks.com/?p=2677#comment-246773</guid>

					<description><![CDATA[the path to the script is /home/joe/Server/minecraft_autobackup.sh
when executed, it is supposed to backup files inside &quot;Server&quot; folder.
Instead, it looks for the files in /home/joe and fails to find the resources it needs from &quot;Server&quot; and wont run.
$PWD=/home/joe The script simply will not change its working directory to anything but my home folder (/home/joe) How might I change the working directory to the &quot;Server&quot; folder for the duration of this script so it will function properly? (By the way I have been &quot;google-ing&quot; this to do it myself for almost a week and ive tried adding dozens of different fixes in the form of new lines or arguments, so its safe to say that &quot;google it&quot; is an option I have completely exhausted.) I&#039;ve tried to &quot;cd&quot; the working directory to &quot;Server&quot; at the beginning of the script, but it has no effect on the process. Needless to say, I am out of options, so here I am. I will post the script beneath the Terminal output. Also, I cut a few irrelevant variables out to meet the character limit for this post.

Terminal Output
joe@joe:~$ /home/joe/Server/minecraft_autobackup.sh
[LOG] Starting Justins AutoBackup Script..
[LOG] Working in directory: /home/joe.
[LOG] Fetching Level Name..
/home/joe/Server/minecraft_autobackup.… line 112: server.properties: No such file or directory

The File

#!/bin/bash
#Autobackup By Justin Smith

#Variables

STAMP=`date +%d-%m-%Y_%H%M%S`

# The screen session name, this is so the script knows where to send the save-all command (for autosave)
SCREENNAME=&quot;minecraft&quot;

# Backups DIR name (NOT FILE PATH)
BACKUPDIR=&quot;backups&quot;

# MineCraft server properties file name
PROPFILE=&quot;server.properties&quot;

# Enable/Disable (0/1) Automatic CronJob Manager
CRONJOB=1

# Update every &#039;n&#039; Minutes
UPDATEMINS=60

# Delete backups older than &#039;n&#039; Days
OLDBACKUPS=3

# Enable/Disable Logging (This will just echo each stage the script reaches, for debugging purposes)
LOGIT=1

# *-------------------------* SCRIPT *-------------------------*
# Set todays backup dir

if [ $LOGIT -eq 1 ]
then
echo &quot;[LOG] Starting Justins AutoBackup Script..&quot;
echo &quot;[LOG] Working in directory: $PWD.&quot;
fi

BACKUPDATE=`date +%d-%m-%Y`
FINALDIR=&quot;$BACKUPDIR/$BACKUPDATE&quot;

if [ $LOGIT -eq 1 ]
then
echo &quot;[LOG] Checking if backup folders exist, if not then create them.&quot;
fi

if [ -d $BACKUPDIR ]
then
echo -n &#060; /dev/null
else
mkdir &#034;$BACKUPDIR&#034;

if [ $LOGIT -eq 1 ]
then
echo &#034;[LOG] Created Folder: $BACKUPDIR&#034;
fi

fi

if [ -d &#034;$FINALDIR&#034; ]
then
echo -n &#060; /dev/null
else
mkdir &#034;$FINALDIR&#034;

if [ $LOGIT -eq 1 ]
then
echo &#034;[LOG] Created Folder: $FINALDIR&#034;
fi

fi

if [ $OLDBACKUPS -lt 0 ]
then
OLDBACKUPS=3
fi

# Deletes backups that are &#039;n&#039; days old
if [ $LOGIT -eq 1 ]
then
echo &#034;[LOG] Removing backups older than 3 days.&#034;
fi
OLDBACKUP=`find $PWD/$BACKUPDIR -type d -mtime +$OLDBACKUPS &#124; grep -v -x &#034;$PWD/$BACKUPDIR&#034; &#124; xargs rm -rf`

# --Check for dependencies--

#Is this system Linux?
#LOL just kidding, at least it better be...

#Get level-name
if [ $LOGIT -eq 1 ]
then
echo &#034;[LOG] Fetching Level Name..&#034;
fi

while read line
do
VARI=`echo $line &#124; cut -d= -f1`
if [ &#034;$VARI&#034; == &#034;level-name&#034; ]
then
WORLD=`echo $line &#124; cut -d= -f2`
fi
done &#060; &#034;$PROPFILE&#034;

if [ $LOGIT -eq 1 ]
then
echo &#034;[LOG] Level-Name is $WORLD&#034;
echo &#034;&#034;
fi

BFILE=&#034;$WORLD.$STAMP.tar.gz&#034;
CMD=&#034;tar -czf $FINALDIR/$BFILE $WORLD&#034;

if [ $LOGIT -eq 1 ]
then
echo &#034;[LOG] Packing and compressing folder: $WORLD to tar file: $FINALDIR/$BFILE&#034;
fi

if [ $NOTIFY -eq 1 ]
then
screen -x $SCREENNAME -X stuff &#034;`printf &#034;say Backing up world: &#039;$WORLD&#039;r&#034;`&#034;
fi

#Create timedated backup and create the backup directory if need.
if [ $AUTOSAVE -eq 1 ]
then
if [ $NOTIFY -eq 1 ]
then
screen -x $SCREENNAME -X stuff &#034;`printf &#034;say Forcing Save..r&#034;`&#034;
fi
#Send save-all to the console
screen -x $SCREENNAME -X stuff `printf &#034;save-allr&#034;`
sleep 2
fi

if [ $NOTIFY -eq 1 ]
then
screen -x $SCREENNAME -X stuff &#034;`printf &#034;say Packing and compressing world...r&#034;`&#034;
fi

# Run backup command
$CMD

if [ $NOTIFY -eq 1 ]
then
# Tell server the backup was completed.
screen -x $SCREENNAME -X stuff &#034;`printf &#034;say Backup Completed.r&#034;`&#034;
fi
]]></description>
			<content:encoded><![CDATA[<p>the path to the script is /home/joe/Server/minecraft_autobackup.sh<br />
when executed, it is supposed to backup files inside &#8220;Server&#8221; folder.<br />
Instead, it looks for the files in /home/joe and fails to find the resources it needs from &#8220;Server&#8221; and wont run.<br />
$PWD=/home/joe The script simply will not change its working directory to anything but my home folder (/home/joe) How might I change the working directory to the &#8220;Server&#8221; folder for the duration of this script so it will function properly? (By the way I have been &#8220;google-ing&#8221; this to do it myself for almost a week and ive tried adding dozens of different fixes in the form of new lines or arguments, so its safe to say that &#8220;google it&#8221; is an option I have completely exhausted.) I&#8217;ve tried to &#8220;cd&#8221; the working directory to &#8220;Server&#8221; at the beginning of the script, but it has no effect on the process. Needless to say, I am out of options, so here I am. I will post the script beneath the Terminal output. Also, I cut a few irrelevant variables out to meet the character limit for this post.</p>
<p>Terminal Output<br />
joe@joe:~$ /home/joe/Server/minecraft_autobackup.sh<br />
[LOG] Starting Justins AutoBackup Script..<br />
[LOG] Working in directory: /home/joe.<br />
[LOG] Fetching Level Name..<br />
/home/joe/Server/minecraft_autobackup.… line 112: server.properties: No such file or directory</p>
<p>The File</p>
<p>#!/bin/bash<br />
#Autobackup By Justin Smith</p>
<p>#Variables</p>
<p>STAMP=`date +%d-%m-%Y_%H%M%S`</p>
<p># The screen session name, this is so the script knows where to send the save-all command (for autosave)<br />
SCREENNAME=&#8221;minecraft&#8221;</p>
<p># Backups DIR name (NOT FILE PATH)<br />
BACKUPDIR=&#8221;backups&#8221;</p>
<p># MineCraft server properties file name<br />
PROPFILE=&#8221;server.properties&#8221;</p>
<p># Enable/Disable (0/1) Automatic CronJob Manager<br />
CRONJOB=1</p>
<p># Update every &#8216;n&#8217; Minutes<br />
UPDATEMINS=60</p>
<p># Delete backups older than &#8216;n&#8217; Days<br />
OLDBACKUPS=3</p>
<p># Enable/Disable Logging (This will just echo each stage the script reaches, for debugging purposes)<br />
LOGIT=1</p>
<p># *&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-* SCRIPT *&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-*<br />
# Set todays backup dir</p>
<p>if [ $LOGIT -eq 1 ]<br />
then<br />
echo &#8220;[LOG] Starting Justins AutoBackup Script..&#8221;<br />
echo &#8220;[LOG] Working in directory: $PWD.&#8221;<br />
fi</p>
<p>BACKUPDATE=`date +%d-%m-%Y`<br />
FINALDIR=&#8221;$BACKUPDIR/$BACKUPDATE&#8221;</p>
<p>if [ $LOGIT -eq 1 ]<br />
then<br />
echo &#8220;[LOG] Checking if backup folders exist, if not then create them.&#8221;<br />
fi</p>
<p>if [ -d $BACKUPDIR ]<br />
then<br />
echo -n &lt; /dev/null<br />
else<br />
mkdir &quot;$BACKUPDIR&quot;</p>
<p>if [ $LOGIT -eq 1 ]<br />
then<br />
echo &quot;[LOG] Created Folder: $BACKUPDIR&quot;<br />
fi</p>
<p>fi</p>
<p>if [ -d &quot;$FINALDIR&quot; ]<br />
then<br />
echo -n &lt; /dev/null<br />
else<br />
mkdir &quot;$FINALDIR&quot;</p>
<p>if [ $LOGIT -eq 1 ]<br />
then<br />
echo &quot;[LOG] Created Folder: $FINALDIR&quot;<br />
fi</p>
<p>fi</p>
<p>if [ $OLDBACKUPS -lt 0 ]<br />
then<br />
OLDBACKUPS=3<br />
fi</p>
<p># Deletes backups that are &#039;n&#039; days old<br />
if [ $LOGIT -eq 1 ]<br />
then<br />
echo &quot;[LOG] Removing backups older than 3 days.&quot;<br />
fi<br />
OLDBACKUP=`find $PWD/$BACKUPDIR -type d -mtime +$OLDBACKUPS | grep -v -x &quot;$PWD/$BACKUPDIR&quot; | xargs rm -rf`</p>
<p># &#8211;Check for dependencies&#8211;</p>
<p>#Is this system Linux?<br />
#LOL just kidding, at least it better be&#8230;</p>
<p>#Get level-name<br />
if [ $LOGIT -eq 1 ]<br />
then<br />
echo &quot;[LOG] Fetching Level Name..&quot;<br />
fi</p>
<p>while read line<br />
do<br />
VARI=`echo $line | cut -d= -f1`<br />
if [ &quot;$VARI&quot; == &quot;level-name&quot; ]<br />
then<br />
WORLD=`echo $line | cut -d= -f2`<br />
fi<br />
done &lt; &quot;$PROPFILE&quot;</p>
<p>if [ $LOGIT -eq 1 ]<br />
then<br />
echo &quot;[LOG] Level-Name is $WORLD&quot;<br />
echo &quot;&quot;<br />
fi</p>
<p>BFILE=&quot;$WORLD.$STAMP.tar.gz&quot;<br />
CMD=&quot;tar -czf $FINALDIR/$BFILE $WORLD&quot;</p>
<p>if [ $LOGIT -eq 1 ]<br />
then<br />
echo &quot;[LOG] Packing and compressing folder: $WORLD to tar file: $FINALDIR/$BFILE&quot;<br />
fi</p>
<p>if [ $NOTIFY -eq 1 ]<br />
then<br />
screen -x $SCREENNAME -X stuff &quot;`printf &quot;say Backing up world: &#039;$WORLD&#039;r&quot;`&quot;<br />
fi</p>
<p>#Create timedated backup and create the backup directory if need.<br />
if [ $AUTOSAVE -eq 1 ]<br />
then<br />
if [ $NOTIFY -eq 1 ]<br />
then<br />
screen -x $SCREENNAME -X stuff &quot;`printf &quot;say Forcing Save..r&quot;`&quot;<br />
fi<br />
#Send save-all to the console<br />
screen -x $SCREENNAME -X stuff `printf &quot;save-allr&quot;`<br />
sleep 2<br />
fi</p>
<p>if [ $NOTIFY -eq 1 ]<br />
then<br />
screen -x $SCREENNAME -X stuff &quot;`printf &quot;say Packing and compressing world&#8230;r&quot;`&quot;<br />
fi</p>
<p># Run backup command<br />
$CMD</p>
<p>if [ $NOTIFY -eq 1 ]<br />
then<br />
# Tell server the backup was completed.<br />
screen -x $SCREENNAME -X stuff &quot;`printf &quot;say Backup Completed.r&quot;`&quot;<br />
fi</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sergeant Pickle		</title>
		<link>https://www.krazyworks.com/compress-old-log-files-on-linux/comment-page-1/#comment-246758</link>

		<dc:creator><![CDATA[Sergeant Pickle]]></dc:creator>
		<pubDate>Fri, 22 Mar 2013 15:42:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.krazyworks.com/?p=2677#comment-246758</guid>

					<description><![CDATA[Write a script that will be given the name of a log file, as a command line arg, and rotate all of the files that start with that name. For instance, if you have a series of log files named foo.1, foo.2, foo.3, then it rotates these to become foo.2, foo.3 and foo.4 respectively and creates a blank file called foo.1. 
Assume that the files are consecutively numbered without skipping any (so that if there is a foo.2, there must be a foo.1 as well). You will first have to find out how many files already exist which you can do use ls name* &#124; wc –l for this. If the number of files is 0, do not rotate anything but instead output an error message. 
Remember that the name will be passed in as a parameter. This script will require, after determining the number of files of the given name, the use of a while loop that counts downward. For instance, if there are 4 files, then the highest number is .4, so we will start at 4 and move .4 into .5, then move .3 into .4, then move .2 into .3 and then move .1 into .2, and then finish off by creating an empty .1 file.

this is what i have so far:

number=0
echo &quot;enter name for log file&quot;
read $1

count= `ls $1* &#124; wc -l`
if [ $count -gt 0 ]
echo &quot;error&quot;
done
else

while count is count
        if [ $count -gt 0 ]
                while [ $count -ne 0 ]
                mv $1.$count $1.$(($count+1))
                mv $1.(($count-1))$1.$count
                mv $1.(($count-2))$1.$count
                mv $1.(($count-3))$1.$count
done
]]></description>
			<content:encoded><![CDATA[<p>Write a script that will be given the name of a log file, as a command line arg, and rotate all of the files that start with that name. For instance, if you have a series of log files named foo.1, foo.2, foo.3, then it rotates these to become foo.2, foo.3 and foo.4 respectively and creates a blank file called foo.1.<br />
Assume that the files are consecutively numbered without skipping any (so that if there is a foo.2, there must be a foo.1 as well). You will first have to find out how many files already exist which you can do use ls name* | wc –l for this. If the number of files is 0, do not rotate anything but instead output an error message.<br />
Remember that the name will be passed in as a parameter. This script will require, after determining the number of files of the given name, the use of a while loop that counts downward. For instance, if there are 4 files, then the highest number is .4, so we will start at 4 and move .4 into .5, then move .3 into .4, then move .2 into .3 and then move .1 into .2, and then finish off by creating an empty .1 file.</p>
<p>this is what i have so far:</p>
<p>number=0<br />
echo &#8220;enter name for log file&#8221;<br />
read $1</p>
<p>count= `ls $1* | wc -l`<br />
if [ $count -gt 0 ]<br />
echo &#8220;error&#8221;<br />
done<br />
else</p>
<p>while count is count<br />
        if [ $count -gt 0 ]<br />
                while [ $count -ne 0 ]<br />
                mv $1.$count $1.$(($count+1))<br />
                mv $1.(($count-1))$1.$count<br />
                mv $1.(($count-2))$1.$count<br />
                mv $1.(($count-3))$1.$count<br />
done</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
