LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation
User Name
Password
Slackware - Installation This forum is for the discussion of installation issues with Slackware.

Notices


Reply
  Search this Thread
Old 07-30-2015, 11:07 PM   #31
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656

Quote:
Originally Posted by bamunds View Post
My suggestion to run a cron job, was based on assuming you would know how to respond to interactive request, like responding to .new files.
If you run a cron job, aren't you removing the ability to respond to the interactive requests? You'd have to run something else to notify you of any .new files and then handle them manually.
 
Old 08-19-2015, 12:09 AM   #32
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
Been working through all the suggestion and am working out "issues". I've removed all the duplicate packages that slackpkg upgrade wanted me to remove or blacklist. Tip: don't name files .orig! I've customarily done this with as-installed files like e.g. /etc/profile, etc/httpd/httpd.conf, and the like before customizing. I found that when a package is uninstalled slackpkg renames the .orig file to be the actual config file! I had quite a bit of restoring to do with php.ini, httpd.conf, httpd-ssl.conf, etc.

Now I have an issue with one of the upgrades not working right -- the point of this posting: is there a way to see the upgrade history? To nail down my issue I need to know when I installed the latest update of this package. The date of the installed files is whenever the package was release, not when it was installed and I cannot seem to find something like `slackpkg history <package>` in either the docs or on the web.

Can I do this?
 
Old 08-19-2015, 02:51 AM   #33
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,058

Rep: Reputation: Disabled
Have a look at /var/log/packages for the date of the most recent installation and to /var/log/removed_packages for the dates of removal/upgrade.
 
Old 08-20-2015, 08:18 AM   #34
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by mfoley View Post
Been working through all the suggestion and am working out "issues". I've removed all the duplicate packages that slackpkg upgrade wanted me to remove or blacklist. Tip: don't name files .orig! I've customarily done this with as-installed files like e.g. /etc/profile, etc/httpd/httpd.conf, and the like before customizing. I found that when a package is uninstalled slackpkg renames the .orig file to be the actual config file! I had quite a bit of restoring to do with php.ini, httpd.conf, httpd-ssl.conf, etc.
Since Didier already answered your other question, I figured I'd just throw in my little anecdote for this.

As an alternative to using .orig, you should be able to switch to .bak (or .back if you prefer). I've been using the .bak method for probably 15 years if not more and never ran into any problems with it (except for when I have .bak, .bak1, .bak-new, etc, and I end up confusing myself on which one I actually want).
 
Old 08-20-2015, 09:13 AM   #35
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by bassmadrigal View Post
Since Didier already answered your other question, I figured I'd just throw in my little anecdote for this.

As an alternative to using .orig, you should be able to switch to .bak (or .back if you prefer). I've been using the .bak method for probably 15 years if not more and never ran into any problems with it (except for when I have .bak, .bak1, .bak-new, etc, and I end up confusing myself on which one I actually want).
I never use .orig or .bak suffices when making backup copies of files or directories, since that is are too generic and error-prone, see the examples in this thread.
When I make a backup copy of a configuration file, I append the suffix .YYYYmmdd, so today's backup of php.ini would become "php.ini.20150820".
 
1 members found this post helpful.
Old 08-20-2015, 04:12 PM   #36
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by Alien Bob View Post
I never use .orig or .bak suffices when making backup copies of files or directories, since that is are too generic and error-prone, see the examples in this thread.
When I make a backup copy of a configuration file, I append the suffix .YYYYmmdd, so today's backup of php.ini would become "php.ini.20150820".
That's a great idea and would definitely fix the problem of running out of .bak extensions, although, I'll still probably keep .bak in there so it is easier for me to find and purge old backups of things that are no longer needed.

Thanks!
 
Old 08-23-2015, 07:20 AM   #37
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
bassmadrigal --

I heartily agree with Eric !

Quote:
Originally Posted by Alien Bob View Post
I never use .orig or .bak suffices when making backup copies of files or directories, since that is are too generic and error-prone, see the examples in this thread.
When I make a backup copy of a configuration file, I append the suffix .YYYYmmdd, so today's backup of php.ini would become "php.ini.20150820".
Quote:
Originally Posted by bassmadrigal View Post
That's a great idea and would definitely fix the problem of running out of .bak extensions, although, I'll still probably keep .bak in there so it is easier for me to find and purge old backups of things that are no longer needed.
Below is a script I use to make TimeStamped BackUps of files and directories.

Save the File someplace in your PATH( I named my copy $HOME/bin/bupfile ) then ...
Code:
chmod 755 $HOME/bin/bupfile
BEWARE: bupfile does not do FileNames with Spaces in them. But who creates FileNames with spaces ? (<G> Fixable, but I don't need it <G>)

Code:
#!/bin/sh

PrgNam="`basename $0`"
DirNam="`dirname  $0`"

if [ "$DirNam" = "." ]
then
   if [ -f "$PrgNam" ]
   then
      DirNam="`pwd`"
   else
      DirNam="`whichone $PrgNam`"
      DirNam="`dirname $DirNam`"
   fi
elif [ "$DirNam" = ".." ]
then
   DirNam="`pwd`"
   DirNam="`dirname $DirNam`"
elif [ "`dirname $DirNam`" = ".." ]
then
   FooNam="`basename $DirNam`"
   DirNam="`pwd -P`"
   DirNam="`dirname $DirNam`/$FooNam"
elif [ "$DirNam" = "" ]               # should not happen ...
then                                  # see: man 3 dirname
   DirNam="`whichone $PrgNam`"
   DirNam="`dirname $DirNam`"
fi

AllArg="$@"
DoSec=0
DoRep=1
MySep='~'
MyTag=''
DoTag=0
Verbose=1
Debug=0      
NumErr=0
MaxErr=1

MyDStr="`date '+%Y%m%d'`"
MyTStr="`date '+%Y%m%d-%H%M%S'`"

export MySep MyTag DoRep

GetExt ()
{
   gawk '
   BEGIN {

      InpStr = "'"$@"'" ""
      OutStr = ""

      for ( i = length( InpStr ) ; i > 1 ; i -- )  # dot-files !
      {
         if (( C = substr( InpStr, i, 1 )) == "." )
         {
            if ( substr( InpStr, i-1, 1 ) != "/" )
            {
               OutStr = substr( InpStr, i )
            }
            break
         }
         if ( C == "/" )
            break
      }
      print OutStr
      exit( 0 )
   }'
   return
}
WacExt ()
{
   myDot="$1" ; shift

   gawk '
   BEGIN {

      myDot  = "'"$myDot"'" ""
      InpStr = "'"$@"'"     ""
      OutStr = InpStr

      for ( i = length( InpStr ) ; i > 1 ; i -- )  # detect dot-files !
      {
         if (( C = substr( InpStr, i, 1 )) == myDot )
         {
            if ( substr( InpStr, i-1, 1 ) != "/" ) # detect dot-files !
            {
               OutStr = substr( InpStr, 1, i-1 )
            }
            break
         }
         if ( C == "/" )
            break
      }
      print OutStr
      exit( 0 )
   }'
   return
}
Error ()
{
   if [ $# -lt 1 ]
   then
      RetCode=1
      echo "unspecified error" >&2
   else
      RetCode=$? ; shift
      echo "$@" >&2
   fi

   exit $RetCode
}
MkNewFile ()
{
   [ $# -lt 1 ] && echo "" && return 4

   myFile="$1"

   [ "$myFile" = ""  ] && echo ""                  && return 5
   [ "$MyTag"  = ""  ] && echo ""                  && return 6
   [ "$DoRep"  = "0" ] && echo "${myFile}${MyTag}" && return 0

   myWacd="$(WacExt "$MySep" "$myFile")"

   echo "${myWacd}${MyTag}"

   return 0
}
Usage ()
{
   ErrNum=$1
   shift

   [ $# -gt 0 ] && echo -e "\n$*" >&2

   echo -e "\nusage:  $PrgNam [ options ] File [ File [ File ... ]]" >&2
   cat  <<Usage_EOF >&2

Program $PrgNam Backs Up ( copies ) one-or-more Files or Directories 
with a DateStamp Suffix: '${MySep}YYYYMMDD'.  

Optionally, if the -s Arg is invoked, $PrgNam will append 
a DateTimeStamp Suffix:  '${MySep}YYYYMMDD-HHMMSS'

Finally, the -t TagORide Arg allows the user to override the default
DateStamp ( or DateTimeStamp ) Suffix with their own Suffix.

Options include:

   -e MaxErr   - Maximum Number of Errors to allow before ABORT

                 Default:  1 error

   -c SepChr   - user-defined Separator Char for the TimeStamp.

                 Default SepChr = '$MySep'

   -s          - use DateTimeStamp.  Format = '${MySep}YYYYMMDD-HHMMSS'

   -a          - do not replace old TimeStamp, append a new one instead.  

                 See Note 3.  Do be careful with this !  FileNames may
                 become arbitrarily long !!!

                 Default:  REPLACE $PrgNam TimeStamp with New One.

                 Note:  On Files with multiple TimeStamps, only the
                 LAST TimeStamp will be replaced.

   -t TagORide - use TagORide instead of the default DateStamp

                 Note:  TagORide is literally appended to the
                 original FileName.  Supply your own punctuation !

                 Note:  the -t TagORide option activates the -a Arg

   -q            operate silently except for errors

                 Default:  echo commands to stderr

Program $PrgNam preserves permissions and Time Stamps on the file 
( as file ownership permissions allow ).

   Simple Examples:

   $PrgNam file              # copies file to file${MySep}${MyDStr}

   $PrgNam -s file           # copies file to file${MySep}${MyTStr}

   $PrgNam -t '.kjh' file    # copies file to file.kjh

Note1:  Program $PrgNam does not operate on SymLinks or Named Pipes !

Note2:  When multiple Files / Directories are processed, all will be
        Tagged with the same TimeStamp no matter how long it takes to
        complete the file copy operations.

Note3:  If a file or directory already includes a $PrgNam TimeStamp, 
        by default the original TimeStamp is REPLACED with the new 
        TimeStamp.

        OTOH, when the -a Arg is invoked, $PrgNam APPENDS the new 
        TimeStamp to any existing TimeStamps.

   Example:  to replace any existing TimeStamps with new ones:  

   $PrgNam file~19990429     # copy file~19990429 to file${MySep}${MyDStr}

   Example:  to append new TimeStamps to any existing ones:

   $PrgNam -a file~19990429  # copy file~19990429 to file~19990429${MySep}${MyDStr}

   Example:  if the -t TagORide Arg is invoked, $PrgNam APPENDS:

   $PrgNam -t .bak file.bak  # copy file.bak to file.bak.bak

Note 4:  This help text is printed to stderr.  To print a hard-copy or to
         pipe it thru a pager:

   Example:  to pass to the less command:

   $PrgNam -h 2>&1 |less

   Example:  to print to 'MyFavoritePrinter'

   $PrgNam -h 2>&1 |lp -dMyFavoritePrinter

Error Codes:

   Error 1 - No Files were submitted on Command Line
   Error 2 - MaxErr Arg was non-numeric or zero
   Error 3 - -t TagORide Arg was empty
   Error 4 - Programmer Error - MkNewFile was invoked without a FileName
   Error 5 - Internal function  MkNewFile was passed an empty FileName
   Error 6 - Internal function  MkNewFile was passed an empty Tag
   Error 7 - Internal function  MkNewFile returned a NULL FileName
   Error 8 - Internal function  MkNewFile returned the same FileName
   Error 9 - NumErr reached MaxErr 

-- kjh  1999-04-29

Usage_EOF
 
   exit $ErrNum

}

while  getopts daqshc:t:e: junk 2>/dev/null
do
   case $junk in
      e)    MaxErr="$OPTARG"
            ;;
      c)    MySep="$OPTARG"
            ;;
      t)    MyTag="$OPTARG"
            DoTag=1
            DoRep=0
            ;;
      s)    DoSec=1
            ;;
      q)    Verbose=0
            ;;
      a)    DoRep=0
            ;;
      d)    Debug=1
            Verbose=1
            ;;
      h)    Usage 0
            ;;
      *)    Usage 1
            ;;
   esac
done

shift `expr $OPTIND - 1`

RetCode=0
FooNum=$(expr $MaxErr + 0 2>/dev/null)

[ $# -lt 1 ]         && Error 1 "$PrgNam needs one-or-more Files to back up"
[ $FooNum -lt 1 ]    && Error 2 "MaxErr must be numeric"

if [ "$DoTag" = "1" ]
then

   [ "$MyTag" = "" ] && Error 3 "-t TagORide is Empty"

elif [ $DoSec -ne 0 ]
then
   MyTag="${MySep}${MyTStr}"
else
   MyTag="${MySep}${MyDStr}"
fi

[ "$Debug" = "1" ] && Verbose=1

NumErr=0

for File in $@
do

   [ "$File" = "" ]                                               && continue  # not an Error
   [ ! -e "$File" ] && echo "$File does not exist"            >&2 && continue  # not an Error
   [   -L "$File" ] && echo "$PrgNam cannot do SymLinks"      >&2 && continue  # not an Error
   [   -p "$File" ] && echo "$PrgNam does not do Named Pipes" >&2 && continue  # not an Error

   NewFile="$(MkNewFile $File)"
   RetCode=$?

   [ "$RetCode" != "0"     ] && Error $RetCode "Something went south ... NewFile = '$NewFile' ; RetCode = $RetCode"
   [ "$NewFile"  = ""      ] && Error 7        "Something went south ... '$NewFile' == ''"
   [ "$NewFile"  = "$File" ] && Error 8        "Something went south ... '$NewFile' == '$File'"

   if [ -d "$File" ]
   then
      Cmd="cp -pR $File $NewFile"
   else
      Cmd="cp -p  $File $NewFile"
   fi

   [ "$Verbose" != "0" ] && ( echo "$Cmd" ; )
   
   if [ "$Debug"   != "1" ]
   then
      $Cmd
      RetCode=$?
   fi

   [ $RetCode -ne 0 ] && NumErr=$(expr $NumErr + 1)

   [ $NumErr -ge $MaxErr ] && RetCode=9 break

done
exit $RetCode
And this is the 'mini man-page' ( type: bupfile -h )

Code:
usage:  bupfile [ options ] File [ File [ File ... ]]

Program bupfile Backs Up ( copies ) one-or-more Files or Directories 
with a DateStamp Suffix: '~YYYYMMDD'.  

Optionally, if the -s Arg is invoked, bupfile will append 
a DateTimeStamp Suffix:  '~YYYYMMDD-HHMMSS'

Finally, the -t TagORide Arg allows the user to override the default
DateStamp ( or DateTimeStamp ) Suffix with their own Suffix.

Options include:

   -e MaxErr   - Maximum Number of Errors to allow before ABORT

                 Default:  1 error

   -c SepChr   - user-defined Separator Char for the TimeStamp.

                 Default SepChr = '~'

   -s          - use DateTimeStamp.  Format = '~YYYYMMDD-HHMMSS'

   -a          - do not replace old TimeStamp, append a new one instead.  

                 See Note 3.  Do be careful with this !  FileNames may
                 become arbitrarily long !!!

                 Default:  REPLACE bupfile TimeStamp with New One.

                 Note:  On Files with multiple TimeStamps, only the
                 LAST TimeStamp will be replaced.

   -t TagORide - use TagORide instead of the default DateStamp

                 Note:  TagORide is literally appended to the
                 original FileName.  Supply your own punctuation !

                 Note:  the -t TagORide option activates the -a Arg

   -q            operate silently except for errors

                 Default:  echo commands to stderr

Program bupfile preserves permissions and Time Stamps on the file 
( as file ownership permissions allow ).

   Simple Examples:

   bupfile file              # copies file to file~20150823

   bupfile -s file           # copies file to file~20150823-065247

   bupfile -t '.kjh' file    # copies file to file.kjh

Note1:  Program bupfile does not operate on SymLinks or Named Pipes !

Note2:  When multiple Files / Directories are processed, all will be
        Tagged with the same TimeStamp no matter how long it takes to
        complete the file copy operations.

Note3:  If a file or directory already includes a bupfile TimeStamp, 
        by default the original TimeStamp is REPLACED with the new 
        TimeStamp.

        OTOH, when the -a Arg is invoked, bupfile APPENDS the new 
        TimeStamp to any existing TimeStamps.

   Example:  to replace any existing TimeStamps with new ones:  

   bupfile file~19990429     # copy file~19990429 to file~20150823

   Example:  to append new TimeStamps to any existing ones:

   bupfile -a file~19990429  # copy file~19990429 to file~19990429~20150823

   Example:  if the -t TagORide Arg is invoked, bupfile APPENDS:

   bupfile -t .bak file.bak  # copy file.bak to file.bak.bak

Note 4:  This help text is printed to stderr.  To print a hard-copy or to
         pipe it thru a pager:

   Example:  to pass to the less command:

   bupfile -h 2>&1 |less

   Example:  to print to 'MyFavoritePrinter'

   bupfile -h 2>&1 |lp -dMyFavoritePrinter

Error Codes:

   Error 1 - No Files were submitted on Command Line
   Error 2 - MaxErr Arg was non-numeric or zero
   Error 3 - -t TagORide Arg was empty
   Error 4 - Programmer Error - MkNewFile was invoked without a FileName
   Error 5 - Internal function  MkNewFile was passed an empty FileName
   Error 6 - Internal function  MkNewFile was passed an empty Tag
   Error 7 - Internal function  MkNewFile returned a NULL FileName
   Error 8 - Internal function  MkNewFile returned the same FileName
   Error 9 - NumErr reached MaxErr 

-- kjh  1999-04-29
One more note: the tilda chars in the script and the help-text look a lot like dash chars ...

Cut-n-Paste worked as expected from firefox into vim but be careful.

The MySep='~' at line 33 in the script is a tilda, not a dash !

Have fun.

-- kjh
 
  


Reply

Tags
slackpkg



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Upgrading via slackpkg mattca Slackware 9 11-10-2013 12:16 PM
[SOLVED] slackpkg upgrade...not upgrading :-( the_penguinator Slackware 3 03-24-2010 07:14 PM
After upgrading with latest slackpkg samac Slackware 2 09-12-2009 06:12 AM
Upgrading glibc 2.3.4 -> 2.3.6 with slackpkg kuitang Slackware 3 03-13-2006 06:36 PM
upgrading the kernel using slackpkg cavalier Slackware 17 05-27-2005 05:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation

All times are GMT -5. The time now is 11:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration