linkdata2sd  Check-in [f929dced50]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:reportes usage presentaban info viciada por no recorrer enlaces
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:f929dced507568593063216965382f63075508fc
User & Date: brau 2016-03-21 01:30:18
Context
2016-04-24
16:32
agrega script crudo para respaldar todo el telefono Leaf check-in: 761290b3e4 user: brau tags: trunk
2016-03-21
01:30
reportes usage presentaban info viciada por no recorrer enlaces check-in: f929dced50 user: brau tags: trunk
00:49
en modo recover renombra opcion delete por deleteall check-in: 4655648ee6 user: brau tags: trunk
Changes

Changes to linksd.sh.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
..
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
...
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
...
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
...
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
#!/system/bin/sh

SDDIR=/data/sdext2/linked_data
DATADIR=/data/data
PREUPDATE=update-linksd

# debug
SDDIR=`realpath debug_linked_data`
DATADIR=`realpath debug_data_data`

now() {
	date +"%Y%m%d_%H%M%S"
}

msg() {
	echo "$@"
................................................................................
}



# dir 
ui_phone_to_sd() {
	cd "$DATADIR"
	usage=`du -sh "$1" | cut -f1`
	echo -n "$1 [$usage, phone] (link/delete/sh/snap): "
	read r
	case "$r" in
		link)
			vers=`now`
			mkdir "$SDDIR" 2>/dev/null
			mkdir "$SDDIR/$1" 2>/dev/null
................................................................................
	esac
}

# listar todas las versiones e indicar la actual
# args: current_ver
ls_vs() {
        for v in `ls`; do
        	usage=`du -sh "$v" | cut -f1`
                if [ "$v" == "$1" ]; then
                        echo " * $v [$usage]"
                else
                        echo "   $v [$usage]"
                fi
        done
}
................................................................................
	else
		vers=""
	fi

	cd `dirname $dest_dir`
	dir=`basename $dest_dir`
	# determina usage y detecta enlaces rotos
	usage=`(du -sh "$dest_dir" || echo broken) | cut -f1`

	(cd $vers_dir && ls_vs $vers)
	echo -n "$1 [$usage, sd] (unlink/delete/forget/sh/VERSION/snap/ren): "
	read r                                                        
	case "$r" in                                                  
		unlink)                                                 
			rm "$DATADIR/$1" ||
................................................................................
		if [ `islinked "$dir"` ]; then
			ui_sd_to_phone "$dir"
		else
			ui_phone_to_sd "$dir"
		fi
	done
  else
          dirs1=`du -s * | sort -rn | cut -f2`
          
          for dir in $dirs1; do
		if [ `islinked "$dir"` ]; then
			ui_sd_to_phone "$dir"
		else
			ui_phone_to_sd "$dir"
		fi







|
|







 







|







 







|







 







|







 







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
..
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
...
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
...
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
...
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
#!/system/bin/sh

SDDIR=/data/sdext2/linked_data
DATADIR=/data/data
PREUPDATE=update-linksd

# debug
#SDDIR=`realpath debug_linked_data`
#DATADIR=`realpath debug_data_data`

now() {
	date +"%Y%m%d_%H%M%S"
}

msg() {
	echo "$@"
................................................................................
}



# dir 
ui_phone_to_sd() {
	cd "$DATADIR"
	usage=`du -shHL "$1" | cut -f1`
	echo -n "$1 [$usage, phone] (link/delete/sh/snap): "
	read r
	case "$r" in
		link)
			vers=`now`
			mkdir "$SDDIR" 2>/dev/null
			mkdir "$SDDIR/$1" 2>/dev/null
................................................................................
	esac
}

# listar todas las versiones e indicar la actual
# args: current_ver
ls_vs() {
        for v in `ls`; do
        	usage=`du -shHL "$v" | cut -f1`
                if [ "$v" == "$1" ]; then
                        echo " * $v [$usage]"
                else
                        echo "   $v [$usage]"
                fi
        done
}
................................................................................
	else
		vers=""
	fi

	cd `dirname $dest_dir`
	dir=`basename $dest_dir`
	# determina usage y detecta enlaces rotos
	usage=`(du -shHL "$dest_dir" || echo broken) | cut -f1`

	(cd $vers_dir && ls_vs $vers)
	echo -n "$1 [$usage, sd] (unlink/delete/forget/sh/VERSION/snap/ren): "
	read r                                                        
	case "$r" in                                                  
		unlink)                                                 
			rm "$DATADIR/$1" ||
................................................................................
		if [ `islinked "$dir"` ]; then
			ui_sd_to_phone "$dir"
		else
			ui_phone_to_sd "$dir"
		fi
	done
  else
          dirs1=`du -sLH * | sort -rn | cut -f2`
          
          for dir in $dirs1; do
		if [ `islinked "$dir"` ]; then
			ui_sd_to_phone "$dir"
		else
			ui_phone_to_sd "$dir"
		fi