Pacbak.sh, backup pacman file lists..

So i'm not sure if someone has done anything like this before.. but I was reading the wiki and just thought I'd hack something together real quick.. This script will let you backup your current pacman installed list, and restore it if you decide to get your box the way you want it.. then all of a sudden it crashes and burns to the ground xD.. Anywho.. I know I could have done a better job but.. i'm lazy. Comments are so very welcome!!!
#!/bin/bash
# Set some random cool looking things :-/
ESC_SEQ="\x1b["
COL_RESET=$ESC_SEQ"39;49;00m"
COL_RED=$ESC_SEQ"31;01m"
COL_CYAN=$ESC_SEQ"36;01m"
# Checking if root
if [ "$(id -u)" != "0" ]; then
echo -e $COL_RED"This script must be run as root"$COL_RESET
exit 1
fi
case "$1" in
backup)
echo -e $COL_CYAN">>"$COL_RESET "Sending the backup command to pacman.."
pacman -Qqe | grep -v "$(pacman -Qmq)" > pacbak.bak
echo -e $COL_CYAN">>"$COL_RESET" Done!"
restore)
echo -e $COL_CYAN">>"$COL_RESET "First lets update pacman"
pacman -Syy
echo -e $COL_CYAN">>"$COL_RESET "Okay, now lets restore our backed up list.."
sleep 2
pacman -S $(cat pacbak.bak)
echo -e $COL_CYAN">>"$COL_RESET "Done!"
info)
echo -e $COL_CYAN">>"$COL_RESET "Simple script to backup and restore your pacman list of installed programs."
echo -e $COL_CYAN">>"$COL_RESET "Created by: Timothy Hoffmeyer <thoffmeyer>"
echo -e $COL_CYAN">>"$COL_RESET "Contact: <[email protected]>"
echo "usage: $0 {backup|restore|info}"
esac
exit 0

Dieter@be wrote:
thoffmeyer wrote:#!/bin/bash
pacman -Qqe | grep -v "$(pacman -Qmq)" > pacbak.bak
Why are you filtering out those packages?
I personally want to backup explicitly installed packages, no matter where they are from.
Tip: host your own binary repo and when you build packages from AUR (or others from source) put them there.
I was setting up a repo @ my sever for packages.. so.. I'm working on it.. Thanks ghost1227.. arch-blocking like that.. lol.

Similar Messages

  • My TC backup file list seems corrupted

    I have had to exclude numerous files from my TC backups to get it working without errors. Now the backup works ok and does all of the select folders but when the next backup happens an hour later then the list of files in the previous backup changes and most of the files that were there in the Now backup are now gone. Each subsequent backup seems to corrupt the file list from the previous backup.
    Any suggestions on how to fix this?

    It's not quite clear what's happening.
    The Today (Now) display is not a backup; it's a representation of what's currently on your system.
    Why did you have to exclude a lot of files?  Were they damaged?  If a lot of files seem to be damaged, the problem might actually be with your backups.  See the pink box in #C3 of Time Machine - Troubleshooting.
    Or do you mean that some items on the exclusion list in Time Machine Prefs > Options are no longer there?  If you delete an item listed there, it will disappear from the list. 
    If you mean Time Machine does back up files that are listed, the file containing the exclusions may be damaged.  If so, try a "full reset" of Time Machine, per #A4 in the above link.
    If none of that helps, please clarify your situation.

  • Time Machine Fails When Trying to Backup Certain Files

    Time Machine is having problems with some files I have copied from a Windows computer. I am a web developer and I moved my client files from a Windows PC to my iMac. Most of the files backup properly but some don't. When Time Machine tries to backup those files, it fails.
    I downloaded Time Machine Buddy and it has helped me identify files that can't be backed up. However, the only solution that works is to delete the files. *Since these are client files, that is not an acceptable solution.*
    When I look at "Get Info", there are several listings for admin, system, staff, owner, and everyone. Each list shows the permissions to be "Custom." I have changed some to "Read and Write" and I have changed all of them to "Read and Write." Neither of these have fixed the problem. Time Machine still fails on the same files.
    I really need some smart Mac person to tell me what I can do to fix this problem. Thanks.

    Csound1 wrote:
    Correct, at no time did I say that this was for everyone, it is in fact for anyone who wishes to spend his time working rather than restoring.
    For most folks, a hard drive failure is not exactly common. If they are to you, something is seriously wrong.
    Replacing a drive in a unibody MBP is a 5 minute operation! & they are cheap!
    Yes, for those who are mechanically inclined and not afraid to open up a Mac. What percentage of users do you suppose that is?
    As to your second point, I suggested specifically using a TM type backup in addition to the clone, I stated that my choice is a realtime service that stores my files (a) as files that I can access from anywhere (b) with versions (including deletions) going back as far as my storage limits allow.
    And how would you use that to roll back to a previous version of your entire system?
    I don't want to have to deal with TM permissions/user/network/extreme/forgetting to delete till it gets full blahblahblah
    Huh? Now you're adding all sorts of other things.
    Permissions? A user account is a user account, and Time Machine maintains the permissions.
    Network? Your clone is on a network? How do you boot up from that?
    Extreme? You use an Airport Extreme for your network clone?
    Forgetting to delete until it's full? Yes, that's exactly what you mentioned above: "versions (including deletions) going back as far as my storage limits allow."
    PleasePondini, do it your way and I'll do it mine
    Obviously.

  • How might I move my Time Machine Backups.backupdb file to a partition on a different drive to enable reformatting the drive it is on, so that might put it back in place later?

    I have an external drive I use as my Time Machine backup location.
    Recently, I started getting an error on it.  It tells me there is a problem, and to repair it with Disk Utility.  Disk Utility cannot verify the disk, and needs me to repair it, but it cannot repair it. It advises me to copy all of the important files from this disk to another location, and then reformat the drive.
    So, I have copied all of the files that were not part of the Backups.backupdb folder structure to a partition on another disk, and removed them from the defecting drive, leaving ~250GB of files in the Time Machine backups files.
    I cannot seem to get this to copy to a ~350GB folder on another drive, formatted Journaled, Extended as recommended.
    What do I do?

    A Time Machine backup is owned by TM.. this is standard kind of issue.. the very fact that you cannot copy it suggests it is corrupt.. or you cannot change permissions on the whole file.. let me assure you the way TM works.. what you have so far copied is completely useless.
    Have you run a verify of the backup??
    The fact that disk utility is not working means something is wrong.. it should be able to fix a drive..
    And the fact the drive is only 12-18months old is also not relevant.. the present state of the drive is too poor to be considered reliable.
    What type of drive is it.. ie USB2 USB3 and what brand??
    It is not just the disk that can go bad but the controller/power supply as well.. and some brands seem to have bad batches.. eg seagate USB drives I was seeing recently.
    I prefer drives where I buy a shell and put the drive into it.. so I can move the drive to another shell without breaking warranty (or the case).
    The actual command for terminal I always just look up when I want to do them.. I am getting old and I have no space left for command line stuff.. although it was all there in the past.
    eg today I hit. http://www.cnet.com/au/news/using-the-os-x-terminal-instead-of-the-finder-to-cop y-files/
    This includes the rsync command.. lets try this one..
    I can copy my downloads directory to a time capsule disk. I start with login as super user just to make sure I don't have permissions issues.. you should definitely do this. running rsync is great as it will give you info when it fails and it will do incremental if you run it again later. You construct the command by simply dragging the folder from finder into terminal and slightly modifying it as per the article above.. So my actual command as I am copying deliberately to a new folder on the TC.. You don't want files to land on the root.. even if it creates another folder.
    $ sudo su
    Password:
    sh-3.2# rsync -av /Users/Ray/Downloads/* /Volumes/DataTCgen3/downloads/
    building file list ... done
    #A 12v25v Descrip.doc
    $T2eC16V,!)!E9s2fB+iqBQNKwsSzpQ~~60_3.JPG
    $_12.JPG
    0198f23d9wahwkzzsf20dk15czcy.pdf
    0340039AINETCNCTKGS.PDF
    I have 60GB or so in this folder and it is copying at about 20MB/s over ethernet.. so it is not super fast.. but there is probably some error checking going on at the same time.

  • A database / file listing of an external drive's contents?

    Had a 2 TB drive sink last weekend, and the backup method seems to have not been backing up since late 2012…  I’m fairly sure the drive and its contents are gone, and I can fairly easily replace a lot of the content, but I would love to have a a text file / database / log indicating what was actually on the drive.   Is that something I might find buried in a Disk Utility log, or the Finder, or somewhere else within the system?  (hopes/prays)A database / file listing of a drive's contents

    Yeah, yeah, I do use TM for my primary drives, but didn't have an extra drive large enough to dedicate to this particular drive.
    I know, I know, "backup everything" ... I promise I will from now on.
    In the meantime, all I'm looking for is a log of some sort so I know what I've lost, what I need to replace.

  • Need a help: how to recover using backup control file?

    Please a help:
    First computer
    1. I create a database
    2. put it in archive mode,
    3. shutdown and made a cold backup
    4. Created backup control file (alter database backup control file to trace)
    5. I started up and created some archived log files.
    Second Computer
    1. I copied all files created in the step 3 above except the control file
    2. I create all the same map directory on the 2nd computer as in the 1st computer
    3. I recreate the control file from the script got in the step 4 above
    4. I Copy archived log files generated at the step 5 in the local directory in the second computer
    5. I set the logsource and set the autorecovery to on
    6. I recover the database: RECOVER DATABASE USING BACKUP CONTROL FILE UNTIL CANCEL
    Error got:
    the archived log file applied do not go beyond the first one?,How could I do to applied all archived log files copied from the first computer to the second computer to have the same data?
    Thank you very much

    archived log sequeces in the first computerSQL> select sequence#,first_change#,next_change# from v$log_history;
    SEQUENCE# FIRST_CHANGE# NEXT_CHANGE#
    1 553723 555484
    2 555484 557345
    Actions I did in the second Computer(after copied the former two archived log files from the 1st computer)
    SQL> CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS ARCHIVELOG
    2 MAXLOGFILES 16
    3 MAXLOGMEMBERS 3
    4 MAXDATAFILES 100
    5 MAXINSTANCES 8
    6 MAXLOGHISTORY 292
    7 LOGFILE
    8 GROUP 1 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO01.LOG' SIZE 50M,
    9 GROUP 2 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO02.LOG' SIZE 50M,
    10 GROUP 3 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO03.LOG' SIZE 50M
    11 -- STANDBY LOGFILE
    12 DATAFILE
    13 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF',
    14 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF',
    15 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF',
    16 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF'
    17 CHARACTER SET WE8ISO8859P1
    18 ;
    Control file created.
    SQL> archive log list;
    Database log mode Archive Mode
    Automatic archival Disabled
    Archive destination USE_DB_RECOVERY_FILE_DEST
    Oldest online log sequence 0
    Next log sequence to archive 0
    Current log sequence 0
    SQL> alter database archivelog;
    Database altered.
    SQL> set logsource C:\local_destination1_orcl
    SQL> set autorecovery on;
    SQL> recover database using backup controlfile until cancel;
    ORA-00279: change 555611 generated at 01/18/2007 14:14:14 needed for thread 1
    ORA-00289: suggestion :
    C:\LOCAL_DESTINATION1_ORCL\ARCH.1_1_612194518_43F17CF5.ARC
    ORA-00280: change 555611 for thread 1 is in sequence #1
    ORA-00328: archived log ends at change 555483, need later change 555611
    ORA-00334: archived log:
    'C:\LOCAL_DESTINATION1_ORCL\ARCH.1_1_612194518_43F17CF5.ARC'
    Idon't know where the change 555611 is coming from?

  • IPod backup/ recovery files on a PC

    Where can I find my iPod backup/ recovery files on my PC (Windows XP) to delete old backup files?

    i already followed what is listed in that support section. but still im loosing 10+ GB of disk space because of the backup i made which i cant delete because its nowhere to be found. pls help asap. thanks.
    sorry for necro posting.

  • When installing a system upgrade, do i need to backup my files, photos, etc. first?

    When installing a system upgrade, do i need to backup my files, photos, etc. first?

    No, you don't need to, but it is highly recommended. Upgrades can fail, the computer may fail, the may be a power outage, etc. Never be without a current backup. Never upgrade until after you make a backup.
    I recommend making a bootable backup by cloning:
    Clone using Restore Option of Disk Utility
      1. Open Disk Utility in the Utilities folder.
      2. Select the destination volume from the left side list.
      3. Click on the Restore tab in the DU main window.
      4. Select the destination volume from the left side list and drag
           it to the Destination entry field.
      5. Select the source volume from the left side list and drag it to
          the Source entry field.
      6. Double-check you got it right, then click on the Restore button.
    Destination means the external backup drive. Source means the internal startup drive.

  • Ghostscript missing description & file list

    Hi, I have problem with ghostscript package.
    yaourt -Sbu --aur
    pidgin-gpg : Orphan
    Foreign packages: | 28 / 28
    'ghostscript-9.10-1': description file is missing
    'ghostscript-9.10-1': file list is missing
    pacman -S ghostscript
    warning: ghostscript-9.10-1 is up to date -- reinstalling
    resolving dependencies...
    looking for inter-conflicts...
    error: could not open file /var/lib/pacman/local/ghostscript-9.10-1/desc: No such file or directory
    Packages (1): ghostscript-9.10-1
    Total Installed Size: 47.00 MiB
    :: Proceed with installation? [Y/n]
    http://pastebin.com/0XT8dEP5
    pacman -R ghostscript
    error: could not open file /var/lib/pacman/local/ghostscript-9.10-1/desc: No such file or directory
    warning: could not fully load metadata for package ghostscript-9.10-1
    checking dependencies...
    error: failed to prepare transaction (could not satisfy dependencies)
    I can not install, remove or replace ghostscript with ghostscript-git
    How fix this bug?

    In the output you pasted to the pastebin, take the files pacman says exist in the file system and check none of them are owned by any package. Then
    pacman -S ghostscript --force
    Note: never use --force unless you are sure you understand what you are doing. Especially not because I say so! It should be safe here if no other package owns those files because those files should belong to ghostscript. So the --force will just overwrite them with fresh copies and, in doing so, will track them as belonging to ghostscript.

  • How can I backup my files to an external drive

    how can I backup my files to an external drive??  Can't seem to drag files to the external drive icon

    Is the drive formatted for the Mac? Is it a new drive? If so it's not formatted properly:
    Drive Preparation
    1.Open Disk Utility in your Utilities folder.
    2. After DU loads select your hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Click on the Partition tab in the DU main window.
    3. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Click on the Options button, set the partition scheme to GUID then click on the OK button. Set the format type to Mac OS Extended (Journaled.) Click on the Partition button and wait until the process has completed.
    4. Select the volume you just created (this is the sub-entry under the drive entry) from the left side list. Click on the Erase tab in the DU main window.
    5. Set the format type to Mac OS Extended (Journaled.) Click on the Security button, check the button for Zero Data and click on OK to return to the Erase window.
    6. Click on the Erase button. The format process can take up to several hours depending upon the drive size.

  • All backup/sync files for Iphone lost on old PC, anyway to sync with new PC without losing music, photos, contacts and texts?

    All backup/sync files for Iphone lost on old PC, anyway to sync with new PC without losing music, photos, contacts and texts?

    Make sure your new computer is authorized in iTunes. Disable autosync in itunes, connect your iphone, right click on it in the device list and choose backup.
    This will save data, pictures and settings to itunes. See what's included in this backup here: http://support.apple.com/kb/HT1766
    Transfer your purchases the same way to copy all apps and bought media from the Store to your computer.
    Set up at least one contact and event on your computer to be able the merge your calendars and contacts after your device got wiped during the first sync.
    The rest of the data can be restored from the backup you made.
    Restoring: http://support.apple.com/kb/HT1414
    Music is one way only, from the computer to your device, unless you bought the songs in itunes and transferred your purchases.
    Apps can be downloaded again for free, in the US music as well. Downloading past purchases from the App Store, iBookstore, and iTunes Store
    There is 3rd party software out there, but not supported by Apple, see this thread: http://discussions.apple.com/thread.jspa?threadID=2013615&tstart=0
    See also How to back up your data and set up as a new device

  • How does one change the font size for folders and/or file lists in the Bookmarks Library?

    How does one change the font size for folders and/or file lists in the '''Bookmarks''' Library?
    Since the upgrade to version 9.0.1 of Firefox, the Bookmarks feature changes are confusing me. They seem to be confusing themselves as well. The list of bookmarks has changed. The font size is so small that my aging eyes cannot read it without fogging the screen with my breath. Some folders are out of alphabetical order (where I know they were previously good), and some are missing altogether (folders to which I frequently add references).
    As for missing or deranged files or folders, was there something that I should have done or now need to do to recover those after the upgrade (or before)?
    With regard to font size,
    1. there is no “Edit Bookmarks” or like option to edit the list in this version
    2. the “zoom” option in the “view” list of functions is greyed out when in “Show All Bookmarks” window
    3. expanding the browser window has no effect on font size
    4. “Preferences” settings for font size has no effect in that window either, including advanced settings
    5. “Help” offers none that I can find.
    Can any of you Help?!?

    Maybe this extension helps:
    *Theme Font & Size Changer: https://addons.mozilla.org/firefox/addon/theme-font-size-changer/

  • Hi, I am using my icloud on my iphone but am unable to find it on my mac book pro. It's not under my system preferences like it shows under the setup. Can I download it again? Or something. I just need to backup some files on my computer and am unable.

    Hi, I am using my icloud on my iphone but am unable to find it on my mac book pro. It's not under my system preferences like it shows under the setup. Can I download it again? Or something. I just need to backup some files on my computer and am unable.

    The minimum requirement for iCloud is Lion 10.7.5 (Mavericks preferred): the iCloud Preference Pane does not appear on earlier systems - the MobileMe pane appears on Lion and earlier but is now non-functional - you cannot now open or access a MobileMe account.
    To make use of iCloud you will have to upgrade your Mac to Lion or Mavericks, provided it meets the requirements.
    The requirements for Lion are:
    Mac computer with an Intel Core 2 Duo, Core i3, Core i5, Core i7, or Xeon processor
    2GB of memory
    OS X v10.6.6 or later (v10.6.8 recommended)
    7GB of available space
    Lion is available in the Online Apple Store ($19.99). Mountain Lion (10.8.x) is also available there at the same price but there seems little point as the system requirements are the same for Mavericks (10.9.x) - which is free - unless you need to run specific software which will run on Mountain Lion only.
    The requirements for Mountain Lion and Mavericks are:
    OS X v10.6.8 or later
    2GB of memory
    8GB of available space
      and the supported models are:
    iMac (Mid 2007 or newer)
    MacBook (Late 2008 Aluminum, or Early 2009 or newer)
    MacBook Pro (Mid/Late 2007 or newer)
    Xserve (Early 2009)
    MacBook Air (Late 2008 or newer)
    Mac mini (Early 2009 or newer)
    Mac Pro (Early 2008 or newer)
    It is available from the Mac App Store (in Applications).
      You should be aware that PPC programs (such as AppleWorks) will not run on Lion or above; and some other applications may not be compatible - there is a useful compatibility checklist at http://roaringapps.com/apps:table

  • URLs in orphaned file list?

    when I check for orphaned files on my very old, very messy
    website I see urls like "/http:/java.sun.com",
    "mailto:[email protected]" and nothing happens when I choose
    "open file". I can delete them from the list but when I run the
    orphaned files check again they're all back! what's going on?
    I recognize most of these as files and links that were
    deleted long ago (them and the pages that linked to them). How is
    dreamweaver finding these links and what are they doing in the
    orphaned files list?

    > I recognize most of these as files and links that were
    deleted long ago
    Under the main dw menu->Site->Advanced->Rebuild Site
    Cache.
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

  • Computer Contents in File List

    My file list now contains all of the items and files in my
    computer, including all materials on my back-up hard drive and the
    network. How do I delete this from the file list.

    That's normal- it belongs there. ignore it or use when it's
    handy.
    It's use is to find and copy files that are outside of the
    Local site folder
    while staying inside of dreamweaver.
    If it wasn't there- you'd have to go to the Desktop or My
    Computer, browse
    to the file, copy it, browse to the Local Site Folder, paste,
    then go back
    into dreamweaver.
    suggestion- go to the Help menu-->Using
    Dreamweaver-->the dreamweaver
    workspace or similar wording.
    > I am new to Dreamweaver 8 but there is s drop down menu
    under file. The drop
    > down is titled computer and when the drop down is open
    my options are
    > Macintosh
    > HD, PSP5000 (which is my back-up drive) and network.
    Separated by a line is
    > manage sites. Does this help?
    >

Maybe you are looking for