<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
  <title>Aforo.es</title>
  <link>https://www.aforo.es/</link>
  <description>Aforo el sitio de los Foros</description>
  <language>es-es</language>
  <pubDate>Fri, 16 Feb 2018 17:44:09 GMT</pubDate>
  <ttl>1440</ttl>
  <generator>Webnaranja</generator>
  <copyright>Aforo.es</copyright>
  <category>Forums - Lenguajes de programacion y Bases de Datos</category>
  <docs>https://cyber.harvard.edu/rss/rss.html</docs>
  <image>
    <url>https://www.aforo.es/images/logo.gif</url>
    <title>Aforo.es</title>
    <link>https://www.aforo.es/</link>
  </image>

<item>
  <title>Macro VBA para limpiar texto de PDF a DOC o Txt-</title>
  <link>https://www.aforo.es/index.php?name=Forums&amp;file=viewtopic&amp;p=1832#1832</link>
  <description>Macro VBA para Word que limpia retornos de carro anómalos en texto procedente de Word. No es perfecta pero al menos hace el 90% del trabajo.


		Code::

	

Sub JoinLowercaseLine&amp;#40;&amp;#41;
&amp;#039; Macro Word para limpiar retornos de carro de texto de PDF
    Rem PASO 1. Sustituir espacios de no separación por espacios normales.
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
   .Text = &amp;quot;^s&amp;quot;
   .Replacement.Text = &amp;quot; &amp;quot;
   .Forward = True
   .Wrap = wdFindContinue
   .Format = False
   .MatchCase = False
   .MatchWholeWord = False
   .MatchAllWordForms = False
   .MatchSoundsLike = False
   .MatchWildcards = True
    End With
    Rem PASO 4.1 Elimino espacios antes de minuscula.
    With Selection.Find
   .Text = &amp;quot;&amp;#91;^13^l^t&amp;#93; &amp;#123;1;&amp;#125;&amp;#40;&amp;#91;a-z&amp;#93;&amp;#41;&amp;quot;
   .Replacement.Text = &amp;quot;\1&amp;quot;
   .Forward = True
   .Wrap = wdFindContinue
   .Format = False
   .MatchCase = False
   .MatchWholeWord = False
   .MatchAllWordForms = False
   .MatchSoundsLike = False
   .MatchWildcards = True
    End With
    Selection.Find.Execute Replace&amp;#58;=wdReplaceAll
    
&amp;#039; Mio
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
   .Text = &amp;quot;^phttp&amp;quot;
   .Replacement.Text = &amp;quot;^pWeb&amp;#58; http&amp;quot;
   .Forward = True
   .Wrap = wdFindAsk
   .Format = False
   .MatchCase = False
   .MatchWholeWord = False
   .MatchWildcards = False
   .MatchSoundsLike = False
   .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace&amp;#58;=wdReplaceAll
    
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
   .Text = &amp;quot;^pwww&amp;quot;
   .Replacement.Text = &amp;quot;^pWeb&amp;#58; www&amp;quot;
   .Forward = True
   .Wrap = wdFindAsk
   .Format = False
   .MatchCase = False
   .MatchWholeWord = False
   .MatchWildcards = False
   .MatchSoundsLike = False
   .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace&amp;#58;=wdReplaceAll
&amp;#039; fin mio

    Rem PASO 2. Segundo, unimos a la anterior linea las lineas que empiezan por lowercase &amp;#40;minuscula&amp;#41;.
    With Selection.Find
   .Text = &amp;quot;&amp;#40;&amp;#91;^13^l^t&amp;#93;&amp;#41;&amp;#40;&amp;#91;a-z&amp;#93;&amp;#41;&amp;quot;
   .Replacement.Text = &amp;quot; \2&amp;quot;
   &amp;#039; .Replacement.Text = &amp;quot;\1$popo$\2&amp;quot;
   .Forward = True
   .Wrap = wdFindContinue
   .Format = False
   .MatchCase = False
   .MatchWholeWord = False
   .MatchAllWordForms = False
   .MatchSoundsLike = False
   .MatchWildcards = True
    End With
    Selection.Find.Execute Replace&amp;#58;=wdReplaceAll
    
    Rem PASO 3. Eliminar todos los espacios redundantes.
    With Selection.Find
   .Text = &amp;quot;&amp;#40; &amp;#41;&amp;#123;1;&amp;#125;&amp;quot;
   .Replacement.Text = &amp;quot;\1&amp;quot;
   .Forward = True
   .Wrap = wdFindContinue
   .Format = False
   .MatchCase = False
   .MatchWholeWord = False
   .MatchAllWordForms = False
   .MatchSoundsLike = False
   .MatchWildcards = True
    End With
    Selection.Find.Execute Replace&amp;#58;=wdReplaceAll
End Sub</description>
  <pubDate>Fri, 16 Feb 2018 17:44:09 GMT</pubDate>
</item>

<item>
  <title>Macro para Conversor Doc o Docx a BBcode-</title>
  <link>https://www.aforo.es/index.php?name=Forums&amp;file=viewtopic&amp;p=1831#1831</link>
  <description>Versión 2 del conversor de Word a BBcode mejorada con sustitución de las imágenes por un indice de imagen y simplificación de la conversión de tamaño de letra:


		Code::

	
&#039;Word2BBCode-Converter v0.1, June 2, 2006
&#039;Matthew Kruer
&#039;Some parts adapted from
&#039;Word2Wiki-Converter V0.4, May 28, 2006
&#039;http&amp;#58;//de.wikipedia.org/wiki/Wikipedia&amp;#58;Helferlein/Word2MediaWikiPlus
&#039;Original Version by InfPro&amp;#58; http&amp;#58;//www.infpro.com/downloads/downloads/wordmedia.htm
&#039;Major improvements by Gunter Schmidt, Mail me&amp;#58; Word2MediaWikiPlus@beadsoft.de
&#039;Works only with Word 2000 and above
&#039;License&amp;#58; GPL&amp;#58; Feel free to use and modify. Keep the credits and do not sell.

Sub Word2BBCode&amp;#40;&amp;#41;
    
    Application.ScreenUpdating = False
        
    ConvertItalic
    ConvertBold
    &#039;ConvertUnderline
    &#039;ConvertLists
    ConvertHyperlinks
    &#039;ConvertColor
    ReplaceInlineShapes_WithIndex
    ConvertSize
    
    ActiveDocument.Content.Copy
    Application.ScreenUpdating = True
    
End Sub

Private Sub ConvertBold&amp;#40;&amp;#41;
    ActiveDocument.Select
    
    With Selection.Find
    
        .ClearFormatting
        .Font.Bold = True
        .Text = &amp;quot;&amp;quot;
        
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
        
        .Forward = True
        .Wrap = wdFindContinue
        
        Do While .Execute
            With Selection
                If InStr&amp;#40;1, .Text, vbCr&amp;#41; Then
                    &#039; Just process the chunk before any newline characters
                    &#039; We&#039;ll pick-up the rest with the next search
                          .Font.Bold = False
                    .Collapse
                    .MoveEndUntil vbCr
                End If
                                       
                &#039; Don&#039;t bother to markup newline characters &amp;#40;prevents a loop, as well&amp;#41;
                If Not .Text = vbCr Then
                    .InsertBefore &amp;quot;&amp;#91;b&amp;#93;&amp;quot;
                    .InsertAfter &amp;quot;&amp;#91;/b&amp;#93;&amp;quot;
                End If
                
                .Font.Bold = False
            End With
        Loop
    End With
End Sub
Private Sub ConvertItalic&amp;#40;&amp;#41;
    ActiveDocument.Select
    
    With Selection.Find
    
        .ClearFormatting
        .Font.Italic = True
        .Text = &amp;quot;&amp;quot;
        
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
        
        .Forward = True
        .Wrap = wdFindContinue
        
        Do While .Execute
            With Selection
                If InStr&amp;#40;1, .Text, vbCr&amp;#41; Then
                    &#039; Just process the chunk before any newline characters
                    &#039; We&#039;ll pick-up the rest with the next search
                    .Font.Italic = False
                    .Collapse
                    .MoveEndUntil vbCr
                End If
                                       
                &#039; Don&#039;t bother to markup newline characters &amp;#40;prevents a loop, as well&amp;#41;
                If Not .Text = vbCr Then
                    .InsertBefore &amp;quot;&amp;#91;i&amp;#93;&amp;quot;
                    .InsertAfter &amp;quot;&amp;#91;/i&amp;#93;&amp;quot;
                End If
                
                .Font.Italic = False
            End With
        Loop
    End With
End Sub
Private Sub ConvertUnderline&amp;#40;&amp;#41;
    ActiveDocument.Select
    
    With Selection.Find
    
        .ClearFormatting
        .Font.Underline = True
        .Text = &amp;quot;&amp;quot;
        
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
        
        .Forward = True
        .Wrap = wdFindContinue
        
        Do While .Execute
            With Selection
                If InStr&amp;#40;1, .Text, vbCr&amp;#41; Then
                    &#039; Just process the chunk before any newline characters
                    &#039; We&#039;ll pick-up the rest with the next search
                    .Font.Underline = False
                    .Collapse
                    .MoveEndUntil vbCr
                End If
                                       
                &#039; Don&#039;t bother to markup newline characters &amp;#40;prevents a loop, as well&amp;#41;
                If Not .Text = vbCr Then
                    .InsertBefore &amp;quot;&amp;#91;u&amp;#93;&amp;quot;
                    .InsertAfter &amp;quot;&amp;#91;/u&amp;#93;&amp;quot;
                End If
                
                .Font.Underline = False
            End With
        Loop
    End With
End Sub


Private Sub ConvertLists&amp;#40;&amp;#41;
   Dim para As Paragraph
    For Each para In ActiveDocument.ListParagraphs
        With para.Range
            .InsertBefore &amp;quot;&amp;#91;List&amp;#93;&amp;quot;
            For i = 1 To .ListFormat.ListLevelNumber
                If .ListFormat.ListType = wdListBullet Then
                    .InsertBefore &amp;quot;&amp;#91;*&amp;#93;&amp;quot;
                Else
                    .InsertBefore &amp;quot;&amp;#91;#&amp;#93;&amp;quot;
                End If
            Next i
            .InsertBefore &amp;quot;&amp;#91;List&amp;#93;&amp;quot;
            .ListFormat.RemoveNumbers
            
        End With
    Next para
End Sub
Private Sub ConvertHyperlinks&amp;#40;&amp;#41;
    &#039;converts Hyperlinks
    &#039;24-MAY-2006&amp;#58; only convert http..., mark others with error marker

Dim hyperCount&amp;amp;
    Dim i&amp;amp;
    Dim addr$ &#039;, title$

    hyperCount = ActiveDocument.Hyperlinks.Count

    For i = 1 To hyperCount

        With ActiveDocument.Hyperlinks&amp;#40;1&amp;#41; &#039;must be 1, since the delete changes count and position

            addr = .Address
            If Trim$&amp;#40;addr&amp;#41; = &amp;quot;&amp;quot; Then addr = &amp;quot;no hyperlink found&amp;quot;
            &#039;title = .Range.Text
           
            &#039;http, ftp
            If LCase&amp;#40;Left$&amp;#40;addr, 4&amp;#41;&amp;#41; = &amp;quot;http&amp;quot; Or LCase&amp;#40;Left$&amp;#40;addr, 3&amp;#41;&amp;#41; = &amp;quot;ftp&amp;quot; Then
                .Delete &#039;hyperlink
                .Range.InsertBefore &amp;quot;&amp;#91;url=&amp;quot; &amp;amp; addr &amp;amp; &amp;quot;&amp;#93;&amp;quot;
                .Range.InsertAfter &amp;quot;&amp;#91;/url&amp;#93;&amp;quot;
               
                GoTo ConvertHyperlinks_Next
            End If
           
            &#039;mailto&amp;#58;
            If LCase&amp;#40;Left$&amp;#40;addr, 7&amp;#41;&amp;#41; = &amp;quot;mailto&amp;#58;&amp;quot; Then
                .Delete &#039;hyperlink
                .Range.InsertBefore &amp;quot;&amp;#91;email&amp;#93;&amp;quot; &amp;amp; addr &amp;amp; &amp;quot; &amp;quot;
                .Range.InsertAfter &amp;quot;&amp;#91;/email&amp;#93;&amp;quot;
               
                GoTo ConvertHyperlinks_Next
            End If
           
            &#039;file guess
            If Len&amp;#40;addr&amp;#41; &amp;gt; 4 Then &#039;the reason for not nice goto
                If Mid$&amp;#40;addr, Len&amp;#40;addr&amp;#41; - 3, 1&amp;#41; = &amp;quot;.&amp;quot; Then
                    .Delete
                    .Range.InsertBefore &amp;quot;&amp;#91;file&amp;#58;//&amp;quot; &amp;amp; Replace&amp;#40;addr, &amp;quot; &amp;quot;, &amp;quot;_&amp;quot;&amp;#41; &amp;amp; &amp;quot; &amp;quot;
                    .Range.InsertAfter &amp;quot;&amp;#93;&amp;quot;
                   
                    GoTo ConvertHyperlinks_Next
                End If
            End If
           
            &#039;unidentified
            .Delete
            .Range.InsertBefore UnableToConvertMarker &amp;amp; &amp;quot;&amp;#91;&amp;quot; &amp;amp; addr &amp;amp; &amp;quot; &amp;quot;
            .Range.InsertAfter &amp;quot;&amp;#93;&amp;quot;

ConvertHyperlinks_Next&amp;#58;
        End With

    Next i

End Sub

Private Sub ReplaceInlineShapes_WithIndex&amp;#40;&amp;#41;

Dim oILShp As InlineShape
Dim ILShpIndex As Integer
For Each oILShp In ActiveDocument.InlineShapes
    ILShpIndex = ILShpIndex + 1
    &#039;insert text in place where InlineShape is located
    ActiveDocument.Range&amp;#40;oILShp.Range.Start, oILShp.Range.End&amp;#41;.Text = _
                                &amp;quot;&amp;#91;Image&amp;quot; &amp;amp; ILShpIndex &amp;amp; &amp;quot;.Jpg&amp;#93;&amp;quot;
    &#039;delete picture is not needed- it was simply replaced with text

Next
End Sub


Private Sub ConvertSize&amp;#40;&amp;#41;

&#039; tag all text of font size &amp;lt;&amp;gt; dfSize
Dim rDcm As Range
Dim l As Long
Dim m As Long
Dim n As Long

&#039; m = ActiveDocument.Styles&amp;#40;&amp;quot;Standard&amp;quot;&amp;#41;.Font.Size &#039; german
&#039; m = ActiveDocument.Styles&amp;#40;&amp;quot;Normal&amp;quot;&amp;#41;.Font.Size &#039; english
m = 11
&#039;get the curent normal size of the document
n = m - 13
&#039;calculate the differencebetween the normal size of the document and the web size &amp;#40;12&amp;#41;


Set rDcm = ActiveDocument.Range
&#039; set all paragraph marks to standard value
&#039; and exclude them by this from processing
With rDcm.Find
.Text = Chr&amp;#40;13&amp;#41;
While .Execute
rDcm.Font.Size = m &#039; &amp;lt;&amp;lt;&amp;lt;
Wend
End With

For l = 1 To 54
Set rDcm = ActiveDocument.Range &#039; &amp;lt;&amp;lt;&amp;lt;&amp;lt;
    If l &amp;lt;= m - 2 Then   &#039; &amp;lt;&amp;lt;&amp;lt;&amp;lt;
        With rDcm.Find
        .Font.Size = l
            While .Execute
                rDcm.Select &#039; for testing only
                rDcm.Font.Size = m &#039; &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;
                rDcm.InsertBefore &amp;quot;&amp;#91;size=9&amp;#93;&amp;quot;
                rDcm.InsertAfter &amp;quot;&amp;#91;/size&amp;#93;&amp;quot;
                rDcm.Start = rDcm.End
                rDcm.End = ActiveDocument.Range.End
            Wend
        End With
    End If
    If l &amp;gt; m + 2 And l &amp;lt; m + 6 Then      &#039; &amp;lt;&amp;lt;&amp;lt;&amp;lt;
        With rDcm.Find
        .Font.Size = l
            While .Execute
                rDcm.Select &#039; for testing only
                rDcm.Font.Size = m &#039; &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;
                rDcm.InsertBefore &amp;quot;&amp;#91;size=18&amp;#93;&amp;quot;
                rDcm.InsertAfter &amp;quot;&amp;#91;/size&amp;#93;&amp;quot;
                rDcm.Start = rDcm.End
                rDcm.End = ActiveDocument.Range.End
            Wend
        End With
    End If
    If l &amp;gt;= m + 6 Then    &#039; &amp;lt;&amp;lt;&amp;lt;&amp;lt;
        With rDcm.Find
        .Font.Size = l
            While .Execute
                rDcm.Select &#039; for testing only
                rDcm.Font.Size = m &#039; &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;
                rDcm.InsertBefore &amp;quot;&amp;#91;size=24&amp;#93;&amp;quot;
                rDcm.InsertAfter &amp;quot;&amp;#91;/size&amp;#93;&amp;quot;
                rDcm.Start = rDcm.End
                rDcm.End = ActiveDocument.Range.End
            Wend
        End With
    End If
    
Next
End Sub</description>
  <pubDate>Thu, 08 Feb 2018 14:28:56 GMT</pubDate>
</item>

<item>
  <title>Patrones de sustituación Notepad++-</title>
  <link>https://www.aforo.es/index.php?name=Forums&amp;file=viewtopic&amp;p=1825#1825</link>
  <description>Algunos patrones curiosos con Notepad++
Ejemplo: eliminar enlaces imageshack

[URL=https://imageshack.com/i/idypSoTnj][IMG]http://imagizer.imageshack.us/v2/640x480q90/661/ypSoTn.jpg[/IMG][/URL]


Para eliminar la parte de antes del enlace marcar la opción de expresiones regulares y utilizar el patron:
\[URL=https://imageshack.com(.*)\]\[IMG\]
Y sustituir por: [IMG]

La segunda parte se puede eliminar con:
[/IMG][/URL]
y sutituir por:
[/IMG]\n (para salta linea).

Como patrón de busqueda tambien se puede usar:
\[URL=https://imageshack.com(.*)\](.*)\[/URL\]

Un patron que filtra completamente el enlace y nos deja solo la imagen es:
(\[URL=https://imageshack.com.*\])(\[IMG\].*\[/IMG\])\[/URL\]
Si le damos como patron a sustituir:
&quot;\2&quot;
Este se queda con el campo 2 que es la imagen sin enlace.

Nos presentará la imagen limpia sin enlace:

[IMG]http://imagizer.imageshack.us/v2/640x480q90/911/XX4R77.jpg[/IMG]</description>
  <pubDate>Mon, 22 Jun 2015 11:48:41 GMT</pubDate>
</item>

<item>
  <title>Borrar mediant ecomando linux la cola de Postfix atascada-</title>
  <link>https://www.aforo.es/index.php?name=Forums&amp;file=viewtopic&amp;p=1824#1824</link>
  <description>A veces la cola de postfix se atasca con miles de correos de basura tras un problema de base de datos. Mientras no los borre no se reciben los correos interesantes, porque esta bloqueado.

Intento acceder al panel de plesk para gestionarlo, pero la pagina de cuelga de tantos email como tiene que presentar...

Asi que me abro una sesion de unix/linux y meto el siguiente comando: postsuper -d ALL

Quote::

	 -bash-4.1# postsuper -d ALL
postsuper: Deleted: 40280 messages
-bash-4.1#
 Y desbloqueados en un par de minutos lo que si no habria bloqueado el buzon de correo del Admin durante semanas. &amp;lt;img src=&quot;/images/smiles/icon_biggrin.gif&quot; alt=&quot;Muy feliz&quot; title=&quot;Muy feliz&quot; /&amp;gt;</description>
  <pubDate>Thu, 17 Jul 2014 17:24:28 GMT</pubDate>
</item>

<item>
  <title>Listar el numero de ficheros en subdirectorios en linux-</title>
  <link>https://www.aforo.es/index.php?name=Forums&amp;file=viewtopic&amp;p=1822#1822</link>
  <description>Necesito contar el numero de ficheros que hay en un determinado path, en linux... y no es tarea sencilla.

Vamos a solucionarlo en dos shell csh y con bash

BASH

Nos abrimos una shell de bash:
 /bin/bash

Y ejecutamos  un bucle ls en una sola linea:

    for i in $( ls ); do echo &quot;$i &quot;.(ls -l $i | wc -l) ; done

Este comando nos da la respuesta:

Quote::

	 for i in $( ls ); do echo $i; ls -l $i | wc -l
1077
1
Calls
20673
CMI
86094
COBA
1
CRC
1
Dual
1

ser@server1-01:~/rbirun/send&gt; exit
 

CSH
Ahora lo solucionamos en un entorno csh, con un bucle foeach.

Al comando: &quot;foreach x (`/bin/ls`)&quot; nos respondera con una prompt en la que debemos ir metiendo las lineas de comando.

Quote::

	 &amp;lt;1059 pop1-01 [ser] :/home/send&amp;gt;foreach x (`/bin/ls`)
foreach?  echo $x
foreach? ls -l $x | wc -l
foreach? end1077
1
CallCompletion
20745
CMI
86102
COBA
1

&amp;lt;1060  pop1-01 [ser] :/home/send&amp;gt; 

Ya ta....</description>
  <pubDate>Tue, 03 Jun 2014 12:43:44 GMT</pubDate>
</item>

<item>
  <title>Error en BCP in con la opcion -C -CSLIB Message: - L0/O0/S0-</title>
  <link>https://www.aforo.es/index.php?name=Forums&amp;file=viewtopic&amp;p=1821#1821</link>
  <description>Intentando un BCP en modo caracteres de una base de datos Sybase 11, me surge un error y no ejecuta nada.
El comando ejecutado fue este:

bcp sdp_db1..appl00_main in &quot;/opt/bcpdir/bcp_moviles&quot; -T -c -U sa -P sybase -S SYB_SDP5

Sin embargo el BCP in me contesta con numerosos errores, uno por linea, con el texto:

Quote::

	 CSLIB Message: - L0/O0/S0/N36/1/0: cs_convert: cslib user api layer: common library error: The result is truncated because the conversion/operation resulted in overflow. 


El problema venía de que al tratar el fichero BCP de caracteres (en origen procedía de un servidor UNIX)  en un editor de texto en mi PC me había cambiado  los finales de linea de UNIX por los de windows.

Como el Windows nos hizo la jugada hemos tenido que cambiar el fin de linea en el comando BCP por defecto con la siguiente opción: -r “\n”

bcp sdp_db1..appl00_main in &quot;/opt/bcpdir/bcp_moviles&quot; -T -c -r &quot;\r&quot; -Usa -P sybase -S SYB_SDP5

Ahora entran las lineas sin problema.

Bueno, da un error:
Quote::

	 Unexpected EOF encountered in BCP data-file.

5014193 rows copied.
Clock Time (ms.): total = 1049000  Avg = 0 (4779.97 rows per sec.)
 

Porque también cambio el final de fichero, pero no es grave y ejecuta el fichero completo (en este caso más de 5 millones de líneas).</description>
  <pubDate>Wed, 05 Feb 2014 03:54:47 GMT</pubDate>
</item>

<item>
  <title>Borrado de fichero en un directorio muy extenso-</title>
  <link>https://www.aforo.es/index.php?name=Forums&amp;file=viewtopic&amp;p=1820#1820</link>
  <description>Otra opcion para borrado de ficheros por fecha es:

Quote::

	 find . -type f -mtime +365 -exec rm -f {} \; 

Borra todos los ficheros mas antiguos de 360 días, en el directorio actual.

Por ejemplo: en &quot;/var/lib/php/session&quot;, para borrar sesiones anteriores a un año.</description>
  <pubDate>Mon, 16 Sep 2013 15:33:53 GMT</pubDate>
</item>

<item>
  <title>Borrado masivo de ficheros con una cierta antiguedad-</title>
  <link>https://www.aforo.es/index.php?name=Forums&amp;file=viewtopic&amp;p=1819#1819</link>
  <description>Para borrar logs o ficheros acumulados con mas de una cierta antiguedad (90 dias en el ejemplo), de forma masiva y sin el problema del &quot;rm ‘Error: Too many arguments’&quot; se puede usar:

find /var/logs/ -name &quot;*nombre_fichero*&quot; -atime +90 -type f -print -exec rm {} \; 

Por ejemplo aqui se explica:
http://www.alejandroarco.es/administracion-de-sistemas/linux/borrar-ficheros-por-fecha-en-linux/</description>
  <pubDate>Mon, 12 Aug 2013 08:59:49 GMT</pubDate>
</item>

<item>
  <title>Alias de rm para evitar catástrofes en csh-</title>
  <link>https://www.aforo.es/index.php?name=Forums&amp;file=viewtopic&amp;p=1818#1818</link>
  <description>Para evitar catastrofes de borrados accidentales de ficheros en csh se pude utilizar un alias de rm, en el que el comando rm interactua y consulta al usuario por cada borrado.

Para ello se usa el alias de rm: rm -i

&quot;rm -i&quot; consulta un borrado siempre antes de realizarlo.

Antes de utilizar el alias, en mi servidor unix, se podia efectuar el borrado del siguiente modo:

Quote::

	 
fserver 1003: touch pp  # cero un fichero vacio llamado &quot;pp&quot;
fserver 1005: rm pp # pido el borrado del fichero &quot;pp&quot; y se ejecuta sin consultar
fserver 1005:
 

Como estoy en csh el perfil del usuario se carga a traves del fichero .login, lo cual me permite modificar el comportamiento del usuario.

Edito el fichero .login y le añado la siguiente línea:

  alias rm &#039;/bin/rm -i \!* &#039;Después de esto hay que entrar de nuevo al usuario, por ejemplo son el comando su - &amp;lt;nombre de usuario&amp;gt;

Ahora hago la misma operación.Quote::

	 server 1003: touch pp  # cero un fichero vacio llamado &quot;pp&quot;
fserver 1005: rm pp # pido el borrado del fichero &quot;pp&quot; y se ejecuta pero consulta
pp: ? (y/n) y
fserver 1005:
 

Con ello evitamos borrados accidentales de ficheros en UNIX.</description>
  <pubDate>Wed, 13 Feb 2013 12:53:50 GMT</pubDate>
</item>

<item>
  <title>Comprimir con Gzip, pero sin toca archivo de origen-</title>
  <link>https://www.aforo.es/index.php?name=Forums&amp;file=viewtopic&amp;p=1808#1808</link>
  <description>Para comprimir con Gzip, si se utiliza el metodo comun &quot;gzip -q archivo&quot;, nos ecnontramos con que el comando Gzip comprime el archivo y lo renombra como &quot;archivo.gz&quot;. Ese comportamiento es indeseable en muchos casos, por ejemplo si el archivo es un log de sistema, en el que se esta escribiendo de forma continua y lo se puede tocar.

Para comprimir, pero sin destruir el archivo origen se puede hacer:

Si es solo un archivo:
Quote::

	   cat fichero_a_comprimir | gzip &gt; fichero_salida.gz  

Si son varios ficheros a comprimir en uno solo
Quote::

	   cat fichero1 fichero2 | gzip &gt; fichero_salida.gz</description>
  <pubDate>Tue, 05 Jun 2012 09:25:49 GMT</pubDate>
</item>

</channel>
</rss>
