Page 1 of 1

cp /from /to change in 3.2?

Posted: 15 Jul 2016, 17:55
by Ed_P
Porteus 3.2 rc4 Cinnamon

I'm trying to make a copy of my /home/guest files. In 3.0 I use:

Code: Select all

cp  -v    /home/guest/*                            $GUEST/
which results in just the files in the /home/guest/ directory being copied.

In 3.2 when I use a similar command I get everything in /home/guest/ including all subdirectories and all hidden subdirectories!! I've tried home/guest/ and /home/guest/*.* with the same inclusive results. I've done a cp --help and reviewed the options but don't see anything that omits subdirectories.

I'm not sure this is a 3.2 bug or simply my lack of knowledge.

Any ideas?

Re: cp /from /to change in 3.2?

Posted: 15 Jul 2016, 18:18
by Bogomips
Have not met this problem, but for what it;s worth there are two options
  • Code: Select all

    zip $GUEST/guest,zip /home/guest/*
    cd $GUEST; unzip guest.zip
    Works when zipping /var/log :)
  • Or Bash

    Code: Select all

    for f in /home/guest/*; do [[ -f $f ]] && cp  -p  $f $GUEST; done
Preserving timestamp. :wink:

Re: cp /from /to change in 3.2?

Posted: 15 Jul 2016, 19:43
by Ed_P
Thanks Bogomips. I tried the 2nd option and still got all the subdirectories.

Re: cp /from /to change in 3.2?

Posted: 15 Jul 2016, 20:00
by Bogomips
  • rc4 Cinnamon

    Code: Select all

    guest@porteus:~$ uname -r; uname -m
    4.6.3-porteus
    x86_64
    
  • Code: Select all

    guest@porteus:~$ ls -l /tmp/gst/
    total 0
    guest@porteus:~$ for f in /var/log/*; do [[ -f $f ]] && sudo cp  -p  $f /tmp/gst/; done
    
    guest@porteus:~$ ls -l /tmp/gst/
    total 232
    -rw-r--r-- 1 root root 16571 Jul 15 18:15 Xorg.0.log
    -rw------- 1 root root     0 Jul  1 03:29 btmp
    -rw-r----- 1 root root   259 Jul 15 19:30 cron
    -rw-r----- 1 root root 17091 Jul 15 18:15 debug
    -rw-r--r-- 1 root root 50406 Jul 15 17:35 dmesg
    -rw-r--r-- 1 root root     0 Jul  2  2014 faillog
    -rw-r--r-- 1 root root     0 Apr  8  2000 lastlog
    -rw-r----- 1 root root     0 Jun 29 19:20 maillog
    -rw-r----- 1 root root 74729 Jul 15 21:51 messages
    -rw-r--r-- 1 root root  1124 Jul 15 18:15 pm-powersave.log
    -rw-r--r-- 1 root root  6086 Jul 15 18:15 pm-suspend.log
    -rw-r--r-- 1 root root  1266 Jul 15 17:34 porteus-livedbg
    -rw-r----- 1 root root  8376 Jul 15 21:56 secure
    -rw-r--r-- 1 root root    61 Jul 15 17:35 slim.log
    -rw-r----- 1 root root     0 Jun 29 19:20 spooler
    -rw-r----- 1 root root 10636 Jul 15 18:15 syslog
    -rw-r--r-- 1 root root  7296 Jul 15 17:35 wtmp
    

Re: cp /from /to change in 3.2?

Posted: 15 Jul 2016, 20:24
by Ed_P
:oops:

Ok, found part of the problem. I'm an idiot. :sorry: I wasn't deleting the /to directory between tests. :sorry:

I'm not done with my experiment so I may post more as this progresses.

Thank you for your patience Bogomips. :friends: